diff --git a/CHANGELOG.md b/CHANGELOG.md index 95bba01f1b..c3de92be68 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Escaped test run output before logging it, to avoid a rich ` MarkupError` - Add a new command `nf-core modules mulled` which can generate the name for a multi-tool container image. - Add a new command `nf-core modules test` which runs pytests locally. +- Linting now recognised `shell` blocks to avoid error `when: condition has too many lines` ([#1557](https://github.com/nf-core/tools/issues/1557)) ## [v2.3.2 - Mercury Vulture Fixed Formatting](https://github.com/nf-core/tools/releases/tag/2.3.2) - [2022-03-24] diff --git a/nf_core/modules/lint/main_nf.py b/nf_core/modules/lint/main_nf.py index 0166fba72d..6504b84566 100644 --- a/nf_core/modules/lint/main_nf.py +++ b/nf_core/modules/lint/main_nf.py @@ -72,6 +72,9 @@ def main_nf(module_lint_object, module): if re.search("script\s*:", l) and state in ["input", "output", "when", "process"]: state = "script" continue + if re.search("shell\s*:", l) and state in ["input", "output", "when", "process"]: + state = "shell" + continue # Perform state-specific linting checks if state == "process" and not _is_empty(module, l):