diff --git a/nf_core/lint.py b/nf_core/lint.py old mode 100644 new mode 100755 index a074bfcbb..1f8bd69bb --- a/nf_core/lint.py +++ b/nf_core/lint.py @@ -309,6 +309,11 @@ def check_nextflow_config(self): self.passed.append((4, "Config variable found: {}".format(cf))) else: self.warned.append((4, "Config variable not found: {}".format(cf))) + + # Check and warn if the process configuration is done with deprecated syntax + process_with_deprecated_syntax = list(set([re.search('^(process\.\$.*?)\.+.*$', ck).group(1) for ck in self.config.keys() if re.match(r'^(process\.\$.*?)\.+.*$', ck)])) + for pd in process_with_deprecated_syntax: + self.warned.append((4, "Process configuration is done with deprecated_syntax: {}".format(pd))) # Check the variables that should be set to 'true' for k in ['timeline.enabled', 'report.enabled', 'trace.enabled', 'dag.enabled']: diff --git a/tests/lint_examples/failing_example/nextflow.config b/tests/lint_examples/failing_example/nextflow.config index 3c89db677..58a0ab703 100644 --- a/tests/lint_examples/failing_example/nextflow.config +++ b/tests/lint_examples/failing_example/nextflow.config @@ -1,3 +1,10 @@ manifest.homePage = 'http://nf-co.re/pipelines' dag.file = "dag.html" + +process { + $deprecatedSyntax { + cpu = 1 + } +} + diff --git a/tests/test_lint.py b/tests/test_lint.py index 2de9e5e70..b3e1ecb33 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -119,7 +119,7 @@ def test_config_variable_example_with_failed(self): """Tests that config variable existence test fails with bad pipeline example""" bad_lint_obj = nf_core.lint.PipelineLint(PATH_FAILING_EXAMPLE) bad_lint_obj.check_nextflow_config() - expectations = {"failed": 17, "warned": 8, "passed": 2} + expectations = {"failed": 17, "warned": 9, "passed": 2} self.assess_lint_status(bad_lint_obj, **expectations) @pytest.mark.xfail(raises=AssertionError)