From 80d4bef21f6972934949865c99728621e312d469 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Wed, 5 Mar 2025 22:42:45 +0100 Subject: [PATCH 01/17] Fix linting default behavior --- nf_core/pipelines/lint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index add22ef7c..e09ded2f0 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -599,7 +599,7 @@ def run_linting( lint_obj._load_lint_config() lint_obj.load_pipeline_config() - if lint_obj.lint_config and not lint_obj.lint_config["nfcore_components"]: + if lint_obj.lint_config and lint_obj.lint_config["nfcore_components"] is not None : module_lint_obj = None subworkflow_lint_obj = None else: From 1cfbcd793bf78984a07558a5b77384d0def55977 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Wed, 5 Mar 2025 22:44:52 +0100 Subject: [PATCH 02/17] Fix linting default behavior --- nf_core/pipelines/lint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index e09ded2f0..5806cdb3e 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -599,7 +599,7 @@ def run_linting( lint_obj._load_lint_config() lint_obj.load_pipeline_config() - if lint_obj.lint_config and lint_obj.lint_config["nfcore_components"] is not None : + if lint_obj.lint_config and lint_obj.lint_config["nfcore_components"] is not None and not lint_obj.lint_config["nfcore_components"]: module_lint_obj = None subworkflow_lint_obj = None else: From bca618f064f5a9f14030470d9806a748094e914e Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Wed, 5 Mar 2025 22:45:44 +0100 Subject: [PATCH 03/17] Update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40a25cba0..da7f58511 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,9 @@ - Add linting for ifEmpty(null) ([#3411](https://github.com/nf-core/tools/pull/3411)) - Fix arbitrarily nested params schema linting ([#3443](https://github.com/nf-core/tools/pull/3443)) -- fix: linting with comments after the input directive ([#3458](https://github.com/nf-core/tools/pull/3458)) +- Fix: linting with comments after the input directive ([#3458](https://github.com/nf-core/tools/pull/3458)) - EDAM ontology fixes ([#3460](https://github.com/nf-core/tools/pull/3460)) +- Fix default linting of nf-core components when `nf-core pipelines lint` is ran ([#3480](https://github.com/nf-core/tools/pull/3480)) ### Modules From a722e0ccc95422ca008bbaa4a287dc0c3c0c0c4d Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Wed, 5 Mar 2025 23:05:21 +0100 Subject: [PATCH 04/17] Add subworkflow test --- tests/pipelines/lint/test_subworkflows_json.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 tests/pipelines/lint/test_subworkflows_json.py diff --git a/tests/pipelines/lint/test_subworkflows_json.py b/tests/pipelines/lint/test_subworkflows_json.py new file mode 100644 index 000000000..ec55d5bdf --- /dev/null +++ b/tests/pipelines/lint/test_subworkflows_json.py @@ -0,0 +1,10 @@ +from ..test_lint import TestLint + + +class TestLintSubworkflowsJson(TestLint): + def test_subworkflows_json_pass(self): + self.lint_obj._load() + results = self.lint_obj.subworkflows_json() + assert len(results.get("warned", [])) == 0 + assert len(results.get("failed", [])) == 0 + assert len(results.get("passed", [])) > 0 From ca95bcf65e9225b49f1b4fd47b5d0ee26d684935 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 00:06:58 +0100 Subject: [PATCH 05/17] Resume --- nf_core/pipelines/lint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 5806cdb3e..add22ef7c 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -599,7 +599,7 @@ def run_linting( lint_obj._load_lint_config() lint_obj.load_pipeline_config() - if lint_obj.lint_config and lint_obj.lint_config["nfcore_components"] is not None and not lint_obj.lint_config["nfcore_components"]: + if lint_obj.lint_config and not lint_obj.lint_config["nfcore_components"]: module_lint_obj = None subworkflow_lint_obj = None else: From 5137b4a37bdbff60d8e6f042f86c0f994feeded1 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 00:13:10 +0100 Subject: [PATCH 06/17] Resume --- nf_core/pipelines/lint/__init__.py | 2 +- tests/pipelines/lint/test_subworkflows_json.py | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 tests/pipelines/lint/test_subworkflows_json.py diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index add22ef7c..5806cdb3e 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -599,7 +599,7 @@ def run_linting( lint_obj._load_lint_config() lint_obj.load_pipeline_config() - if lint_obj.lint_config and not lint_obj.lint_config["nfcore_components"]: + if lint_obj.lint_config and lint_obj.lint_config["nfcore_components"] is not None and not lint_obj.lint_config["nfcore_components"]: module_lint_obj = None subworkflow_lint_obj = None else: diff --git a/tests/pipelines/lint/test_subworkflows_json.py b/tests/pipelines/lint/test_subworkflows_json.py deleted file mode 100644 index ec55d5bdf..000000000 --- a/tests/pipelines/lint/test_subworkflows_json.py +++ /dev/null @@ -1,10 +0,0 @@ -from ..test_lint import TestLint - - -class TestLintSubworkflowsJson(TestLint): - def test_subworkflows_json_pass(self): - self.lint_obj._load() - results = self.lint_obj.subworkflows_json() - assert len(results.get("warned", [])) == 0 - assert len(results.get("failed", [])) == 0 - assert len(results.get("passed", [])) > 0 From cd00f2e7979c04ac80c589450630a5a3dada69fc Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 00:18:50 +0100 Subject: [PATCH 07/17] Fix linting --- nf_core/pipelines/lint/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 5806cdb3e..79c10f45d 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -599,7 +599,11 @@ def run_linting( lint_obj._load_lint_config() lint_obj.load_pipeline_config() - if lint_obj.lint_config and lint_obj.lint_config["nfcore_components"] is not None and not lint_obj.lint_config["nfcore_components"]: + if ( + lint_obj.lint_config + and lint_obj.lint_config["nfcore_components"] is not None + and not lint_obj.lint_config["nfcore_components"] + ): module_lint_obj = None subworkflow_lint_obj = None else: From 690e2063444955cfcb7ac43daa69ca7cf03906d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Louis=20Le=20N=C3=A9zet?= <58640615+LouisLeNezet@users.noreply.github.com> Date: Thu, 6 Mar 2025 15:24:26 +0100 Subject: [PATCH 08/17] Update nf_core/pipelines/lint/__init__.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: JĂșlia Mir Pedrol --- nf_core/pipelines/lint/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 79c10f45d..b9d35c521 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -601,8 +601,8 @@ def run_linting( if ( lint_obj.lint_config - and lint_obj.lint_config["nfcore_components"] is not None - and not lint_obj.lint_config["nfcore_components"] + and (not lint_obj.lint_config["nfcore_components"] + or lint_obj.lint_config["nfcore_components"] is not None) ): module_lint_obj = None subworkflow_lint_obj = None From da76c900b46ccafda9885c4f9727618dc3bf815f Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 15:27:24 +0100 Subject: [PATCH 09/17] Fix linting --- nf_core/pipelines/lint/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index b9d35c521..7847439fe 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -600,9 +600,10 @@ def run_linting( lint_obj.load_pipeline_config() if ( - lint_obj.lint_config - and (not lint_obj.lint_config["nfcore_components"] - or lint_obj.lint_config["nfcore_components"] is not None) + lint_obj.lint_config and ( + not lint_obj.lint_config["nfcore_components"] + or lint_obj.lint_config["nfcore_components"] is not None + ) ): module_lint_obj = None subworkflow_lint_obj = None From 70f75550a1a99caf00203d154b402f37b751065a Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 15:41:07 +0100 Subject: [PATCH 10/17] Fix test --- nf_core/pipelines/lint/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 7847439fe..cd4f67948 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -601,8 +601,8 @@ def run_linting( if ( lint_obj.lint_config and ( - not lint_obj.lint_config["nfcore_components"] - or lint_obj.lint_config["nfcore_components"] is not None + not lint_obj.lint_config["nfcore_components"] or + lint_obj.lint_config["nfcore_components"] is None ) ): module_lint_obj = None From 0e8e7d0e1e2fb5c930e14acaa00b5e6a32677616 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 15:44:42 +0100 Subject: [PATCH 11/17] Fix --- nf_core/pipelines/lint/__init__.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index cd4f67948..37d709f5e 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -600,10 +600,8 @@ def run_linting( lint_obj.load_pipeline_config() if ( - lint_obj.lint_config and ( - not lint_obj.lint_config["nfcore_components"] or - lint_obj.lint_config["nfcore_components"] is None - ) + lint_obj.lint_config and + lint_obj.lint_config.get("nfcore_components") ): module_lint_obj = None subworkflow_lint_obj = None From 7733a3daee2195e5a0042b21ded1d7b29ca59c70 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 15:48:13 +0100 Subject: [PATCH 12/17] Fix --- nf_core/pipelines/lint/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 37d709f5e..95fe2fd72 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -600,8 +600,9 @@ def run_linting( lint_obj.load_pipeline_config() if ( - lint_obj.lint_config and - lint_obj.lint_config.get("nfcore_components") + lint_obj.lint_config and + lint_obj.lint_config.get("nfcore_components") is not None and + not lint_obj.lint_config["nfcore_components"] ): module_lint_obj = None subworkflow_lint_obj = None From 477adf945dde68124afaedd07321429b6deb2b0a Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 15:51:59 +0100 Subject: [PATCH 13/17] Fix --- nf_core/pipelines/lint/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 95fe2fd72..50e3635d1 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -600,7 +600,7 @@ def run_linting( lint_obj.load_pipeline_config() if ( - lint_obj.lint_config and + lint_obj.lint_config and lint_obj.lint_config.get("nfcore_components") is not None and not lint_obj.lint_config["nfcore_components"] ): From ba2e76c34155b0666ce98d656b6605647d4868c2 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 15:54:04 +0100 Subject: [PATCH 14/17] Fix --- nf_core/pipelines/lint/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 50e3635d1..97c55fd5f 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -600,9 +600,9 @@ def run_linting( lint_obj.load_pipeline_config() if ( - lint_obj.lint_config and - lint_obj.lint_config.get("nfcore_components") is not None and - not lint_obj.lint_config["nfcore_components"] + lint_obj.lint_config + and lint_obj.lint_config.get("nfcore_components") is not None + and not lint_obj.lint_config["nfcore_components"] ): module_lint_obj = None subworkflow_lint_obj = None From d478ace5bc0f88fa4c241c38dee1ee2d6663125a Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 16:22:54 +0100 Subject: [PATCH 15/17] Fix --- nf_core/pipelines/lint/__init__.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 97c55fd5f..297638d90 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -600,9 +600,8 @@ def run_linting( lint_obj.load_pipeline_config() if ( - lint_obj.lint_config - and lint_obj.lint_config.get("nfcore_components") is not None - and not lint_obj.lint_config["nfcore_components"] + lint_obj.lint_config and + lint_obj.lint_config["nfcore_components"] is not None ): module_lint_obj = None subworkflow_lint_obj = None From 80c04858a5e5a580830c1bdd203438e4475e7f65 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 16:25:20 +0100 Subject: [PATCH 16/17] Fix --- nf_core/pipelines/lint/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 297638d90..685c344d1 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -600,8 +600,8 @@ def run_linting( lint_obj.load_pipeline_config() if ( - lint_obj.lint_config and - lint_obj.lint_config["nfcore_components"] is not None + lint_obj.lint_config + and lint_obj.lint_config["nfcore_components"] is not None ): module_lint_obj = None subworkflow_lint_obj = None From 33650677847f49eb4654c9d963ab5844e36337d5 Mon Sep 17 00:00:00 2001 From: Louis Le Nezet Date: Thu, 6 Mar 2025 16:30:52 +0100 Subject: [PATCH 17/17] Fix --- nf_core/pipelines/lint/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nf_core/pipelines/lint/__init__.py b/nf_core/pipelines/lint/__init__.py index 685c344d1..c0bb61d3e 100644 --- a/nf_core/pipelines/lint/__init__.py +++ b/nf_core/pipelines/lint/__init__.py @@ -599,10 +599,7 @@ def run_linting( lint_obj._load_lint_config() lint_obj.load_pipeline_config() - if ( - lint_obj.lint_config - and lint_obj.lint_config["nfcore_components"] is not None - ): + if lint_obj.lint_config and lint_obj.lint_config["nfcore_components"] is not None: module_lint_obj = None subworkflow_lint_obj = None else: