From ff02cf00d56267f6ff1e84ab5d526f1fdbef516f Mon Sep 17 00:00:00 2001 From: fabianegli Date: Wed, 18 May 2022 13:54:08 +0200 Subject: [PATCH 1/2] fix regex behaviour --- nf_core/modules/lint/main_nf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index 31dc6d5495..7e2ebdeacb 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -241,7 +241,9 @@ def check_process_section(self, lines): if l.startswith("https://containers") or l.startswith("https://depot"): # e.g. "https://containers.biocontainers.pro/s3/SingImgsRepo/biocontainers/v1.2.0_cv1/biocontainers_v1.2.0_cv1.img' :" -> v1.2.0_cv1 # e.g. "https://depot.galaxyproject.org/singularity/fastqc:0.11.9--0' :" -> 0.11.9--0 - singularity_tag = re.search("(?:\/)?(?:biocontainers_)?(?::)?([A-Za-z\d\-_\.]+)(?:\.img)?['\"]", l).group(1) + singularity_tag = re.search("(?:\/)?(?:biocontainers_)?(?::)?([A-Za-z\d\-_\.]+?)(?:\.img)?['\"]", l).group( + 1 + ) if l.startswith("biocontainers/") or l.startswith("quay.io/"): # e.g. "quay.io/biocontainers/krona:2.7.1--pl526_5' }" -> 2.7.1--pl526_5 # e.g. "biocontainers/biocontainers:v1.2.0_cv1' }" -> v1.2.0_cv1 From 0126c047d7700af2c2e2e8b7fcb07dfbaf6af8a6 Mon Sep 17 00:00:00 2001 From: fabianegli Date: Wed, 18 May 2022 15:05:21 +0200 Subject: [PATCH 2/2] document regex fix in changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e5584a365..f55c702b01 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ ### Modules +- Fix a bug in the regex extracting the version from biocontainers URLs [#1596](https://github.com/nf-core/tools/pull/1596) + ## [v2.4.1 - Cobolt Koala Patch](https://github.com/nf-core/tools/releases/tag/2.4) - [2022-05-16] - Patch release to try to fix the template sync ([#1585](https://github.com/nf-core/tools/pull/1585))