diff --git a/CHANGELOG.md b/CHANGELOG.md index 56398753fc..dcedf5f366 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ ### Linting - accept `process_low_memory` as a standard module label ([#4264](https://github.com/nf-core/tools/pull/4264)) +- make regex for meta keys more specific to avoid false positives ([#XXXX](https://github.com/nf-core/tools/pull/XXXX)) ### Modules diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index b589bc3f0c..86b3d0f206 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -304,7 +304,7 @@ def check_script_section(self, lines): permitted_meta_keys = {"id", "single_end"} invalid_meta_keys = [ f"{prefix}{key}" - for prefix, key in re.findall(r"\b(meta\d*\??\.)(\w+)\b(?!\()", script) + for prefix, key in re.findall(r"\b({(meta\d*\??\.)(\w+)\b(?!\()})", script) if key not in permitted_meta_keys ] if not invalid_meta_keys: