Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nf-core lint: Badge Warning #1613

Closed
sguizard opened this issue May 31, 2022 · 8 comments
Closed

nf-core lint: Badge Warning #1613

sguizard opened this issue May 31, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@sguizard
Copy link
Contributor

Description of the bug

nf-core lint gives a warning about badges:
readme: README did not have a Nextflow minimum version badge.

I tried to match the badge code to the nextflowVersion, but the warning is still here.

-> nextflow.config:
nextflowVersion = '!>=21.10.3'
-> README.md (original)
[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A521.10.3-23aa62.svg)](https://www.nextflow.io/)
-> README.md (matching nextflow.config)
[![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-!%3E%3D21.10.3-23aa62.svg)](https://www.nextflow.io/)

Command used and terminal output

╰─>$ nf-core lint

                                          ,--./,-.
          ___     __   __   __   ___     /,-._.--~\
    |\ | |__  __ /  ` /  \ |__) |__         }  {
    | \| |       \__, \__/ |  \ |___     \`-._,-`-,
                                          `._,._,'

    nf-core/tools version 2.4.1 - https://nf-co.re


INFO     Testing pipeline: .                                                                                                                                                                          __init__.py:244

╭─ [!] 3 Pipeline Test Warnings ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│                                                                                                                                                                                                                   │
│ readme: README did not have a Nextflow minimum version badge.                                                                                                                                                     │
│ pipeline_todos: TODO string in meta.yml: #Delete / customise this example output                                                                                                                                  │
│ pipeline_todos: TODO string in WorkflowMain.groovy: Add Zenodo DOI for pipeline after first release                                                                                                               │
│                                                                                                                                                                                                                   │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯

╭───────────────────────╮
│ LINT RESULTS SUMMARY  │
├───────────────────────┤
│ [✔] 203 Tests Passed  │
│ [?]   0 Tests Ignored │
│ [!]   3 Test Warnings │
│ [✗]   0 Tests Failed  │
╰───────────────────────╯

System information

Nextflow version: 21.10.3
Hardware: Desktop
Executor: local
OS: Kubuntu
Version of nf-core/tools: 2.4.1
Python version: 3.9.7

@sguizard sguizard added the bug Something isn't working label May 31, 2022
@fabianegli
Copy link
Contributor

I believe this has been fixed in #1590

@sguizard
Copy link
Contributor Author

sguizard commented May 31, 2022

It's different, here the error is on signs before the version number.
The badge shows 21.10.3, the config file contains !>=21.10.3.
@ewels suggests updating the regexp

nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-%E2%89%A5([\d\.]+)-23aa62\.svg\?labelColor=000000\)\]\(https://www\.nextflow\.io/\)"

@fabianegli
Copy link
Contributor

So this would then be a "lower than" Nextflow version instead of a minimal version. Couldn't "!>=" just be "<".

Changes might be warranted beyond the regex. e.g. the version check failure message text.

@ewels
Copy link
Member

ewels commented Jun 1, 2022

I think that the meaning of the the additional ! is that the pipeline will refuse to run with lower versions of Nextflow, instead of just throwing a warning.

For sure the best fix would be to check both the version number and the operator throughout the pipeline. But in practice it's basically always going to be either >= or !>= I think and they're super similar. So in terms of an easier fix just making the regex more flexible in this location is the simplest solution I think.

@sguizard did you update the readme badge manually or was this done by nf-core bump-version?

@sguizard
Copy link
Contributor Author

sguizard commented Jun 1, 2022

I modified the readme manually,
The problem might also come from the sign.
The badge use and the readme use >=.

@fabianegli
Copy link
Contributor

Yes, it's both, the '!' and the sign.

$ python3 -c 'from urllib.parse import quote; print(quote("!>="))'
%21%3E%3D
$ python3 -c "from urllib.parse import unquote; print(unquote('%21%3E%3D'))"
!>=
$ python3 -c 'from urllib.parse import quote; print(quote("!≥"))'
%21%E2%89%A5
$ python3 -c "from urllib.parse import unquote; print(unquote('%21%E2%89%A5'))"
!≥

@ewels
Copy link
Member

ewels commented Jun 1, 2022

Lets keep things simple and just tolerate all the different symbols in the regex and check only the number 👍🏻

@sguizard sguizard mentioned this issue Jun 1, 2022
3 tasks
ErikDanielsson added a commit that referenced this issue Jun 28, 2022
@ErikDanielsson
Copy link
Contributor

Closing due to merge of #1618

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants