From c8f3dc0b02d0b33a5c1c8fb8eed9e9034054b710 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Tue, 19 Mar 2024 10:04:10 +0000 Subject: [PATCH 01/11] Add nf_core_version to .nf-core.yml --- nf_core/pipeline-template/.nf-core.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/nf_core/pipeline-template/.nf-core.yml b/nf_core/pipeline-template/.nf-core.yml index 3805dc81c1..e8140bfb12 100644 --- a/nf_core/pipeline-template/.nf-core.yml +++ b/nf_core/pipeline-template/.nf-core.yml @@ -1 +1,2 @@ repository_type: pipeline +nf_core_version: "{{ nf_core_version }}" From c1d9dbd09f918050e14951ade2d8a7354f476512 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Tue, 19 Mar 2024 10:10:49 +0000 Subject: [PATCH 02/11] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e3189edaa..d7b58a0319 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Fix topic extraction step for hashtags in toots ([#2810](https://github.com/nf-core/tools/pull/2810)) - Update modules and subworkflows in the template ([#2811](https://github.com/nf-core/tools/pull/2811)) - Unpin setup-nextflow and action-tower-launch ([#2806](https://github.com/nf-core/tools/pull/2806)) +- Add nf-core-version to `.nf-core.yml` ([#2874](https://github.com/nf-core/tools/pull/2874)) ### Download From 099c01dbfd4ff86c1a1c8235067e07d5ca0292d9 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Wed, 20 Mar 2024 11:41:57 +0000 Subject: [PATCH 03/11] setup .nf-core.yml lint --- nf_core/lint/nfcore_yml.py | 61 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 nf_core/lint/nfcore_yml.py diff --git a/nf_core/lint/nfcore_yml.py b/nf_core/lint/nfcore_yml.py new file mode 100644 index 0000000000..4b165c78e4 --- /dev/null +++ b/nf_core/lint/nfcore_yml.py @@ -0,0 +1,61 @@ +def nfcore_yml(self): + """Repository ``.nf-core.yml`` tests + + The ``.nf-core.yml`` contains metadata for nf-core tools to correctly apply its features. + + * repository type: + + * Check that the repository type is set. + + * nf core version: + + * Check if the nf-core version is set to the latest version. + + """ + passed = [] + warned = [] + failed = [] + + # Remove field that should be ignored according to the linting config + # ignore_configs = self.lint_config.get(".nf-core", []) + + # with open(os.path.join(self.wf_path, ".nf-core.yml")) as fh: + # content = fh.read() + + # if "nextflow_badge" not in ignore_configs: + # # Check that there is a readme badge showing the minimum required version of Nextflow + # # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A523.04.0-23aa62.svg)](https://www.nextflow.io/) + # # and that it has the correct version + # nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-!?(?:%E2%89%A5|%3E%3D)([\d\.]+)-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)" + # match = re.search(nf_badge_re, content) + # if match: + # nf_badge_version = match.group(1).strip("'\"") + # try: + # if nf_badge_version != self.minNextflowVersion: + # raise AssertionError() + # except (AssertionError, KeyError): + # failed.append( + # f"README Nextflow minimum version badge does not match config. Badge: `{nf_badge_version}`, " + # f"Config: `{self.minNextflowVersion}`" + # ) + # else: + # passed.append( + # f"README Nextflow minimum version badge matched config. Badge: `{nf_badge_version}`, " + # f"Config: `{self.minNextflowVersion}`" + # ) + # else: + # warned.append("README did not have a Nextflow minimum version badge.") + + # if "zenodo_doi" not in ignore_configs: + # # Check that zenodo.XXXXXXX has been replaced with the zendo.DOI + # zenodo_re = r"/zenodo\.X+" + # match = re.search(zenodo_re, content) + # if match: + # warned.append( + # "README contains the placeholder `zenodo.XXXXXXX`. " + # "This should be replaced with the zenodo doi (after the first release)." + # ) + # else: + # passed.append("README Zenodo placeholder was replaced with DOI.") + + return {"passed": passed, "warned": warned, "failed": failed} From 353fc04e90591bf79a22b07f12716c4c974e8443 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Wed, 20 Mar 2024 13:26:43 +0000 Subject: [PATCH 04/11] Add nfcore_yml linting module*** --- nf_core/lint/__init__.py | 2 + nf_core/lint/nfcore_yml.py | 93 ++++++++++++++++++++++---------------- tests/lint/nfcore_yml.py | 53 ++++++++++++++++++++++ tests/test_lint.py | 5 ++ 4 files changed, 113 insertions(+), 40 deletions(-) create mode 100644 tests/lint/nfcore_yml.py diff --git a/nf_core/lint/__init__.py b/nf_core/lint/__init__.py index be9ac183a6..a14ac15691 100644 --- a/nf_core/lint/__init__.py +++ b/nf_core/lint/__init__.py @@ -206,6 +206,7 @@ class PipelineLint(nf_core.utils.Pipeline): from .modules_structure import modules_structure # type: ignore[misc] from .multiqc_config import multiqc_config # type: ignore[misc] from .nextflow_config import nextflow_config # type: ignore[misc] + from .nfcore_yml import nfcore_yml # type: ignore[misc] from .pipeline_name_conventions import ( # type: ignore[misc] pipeline_name_conventions, ) @@ -264,6 +265,7 @@ def _get_all_lint_tests(release_mode): "modules_json", "multiqc_config", "modules_structure", + "nfcore_yml", ] + (["version_consistency"] if release_mode else []) def _load(self): diff --git a/nf_core/lint/nfcore_yml.py b/nf_core/lint/nfcore_yml.py index 4b165c78e4..6d9f664871 100644 --- a/nf_core/lint/nfcore_yml.py +++ b/nf_core/lint/nfcore_yml.py @@ -1,3 +1,11 @@ +import os +import re + +from nf_core import __version__ + +REPOSITORY_TYPES = ["pipeline", "modules"] + + def nfcore_yml(self): """Repository ``.nf-core.yml`` tests @@ -15,47 +23,52 @@ def nfcore_yml(self): passed = [] warned = [] failed = [] + ignored = [] # Remove field that should be ignored according to the linting config - # ignore_configs = self.lint_config.get(".nf-core", []) - - # with open(os.path.join(self.wf_path, ".nf-core.yml")) as fh: - # content = fh.read() - - # if "nextflow_badge" not in ignore_configs: - # # Check that there is a readme badge showing the minimum required version of Nextflow - # # [![Nextflow](https://img.shields.io/badge/nextflow%20DSL2-%E2%89%A523.04.0-23aa62.svg)](https://www.nextflow.io/) - # # and that it has the correct version - # nf_badge_re = r"\[!\[Nextflow\]\(https://img\.shields\.io/badge/nextflow%20DSL2-!?(?:%E2%89%A5|%3E%3D)([\d\.]+)-23aa62\.svg\)\]\(https://www\.nextflow\.io/\)" - # match = re.search(nf_badge_re, content) - # if match: - # nf_badge_version = match.group(1).strip("'\"") - # try: - # if nf_badge_version != self.minNextflowVersion: - # raise AssertionError() - # except (AssertionError, KeyError): - # failed.append( - # f"README Nextflow minimum version badge does not match config. Badge: `{nf_badge_version}`, " - # f"Config: `{self.minNextflowVersion}`" - # ) - # else: - # passed.append( - # f"README Nextflow minimum version badge matched config. Badge: `{nf_badge_version}`, " - # f"Config: `{self.minNextflowVersion}`" - # ) - # else: - # warned.append("README did not have a Nextflow minimum version badge.") - - # if "zenodo_doi" not in ignore_configs: - # # Check that zenodo.XXXXXXX has been replaced with the zendo.DOI - # zenodo_re = r"/zenodo\.X+" - # match = re.search(zenodo_re, content) - # if match: - # warned.append( - # "README contains the placeholder `zenodo.XXXXXXX`. " - # "This should be replaced with the zenodo doi (after the first release)." - # ) - # else: - # passed.append("README Zenodo placeholder was replaced with DOI.") + ignore_configs = self.lint_config.get(".nf-core", []) + + try: + with open(os.path.join(self.wf_path, ".nf-core.yml")) as fh: + content = fh.read() + except FileNotFoundError: + with open(os.path.join(self.wf_path, ".nf-core.yaml")) as fh: + content = fh.read() + + if "repository_type" not in ignore_configs: + # Check that the repository type is set in the .nf-core.yml + repo_type_re = r"repository_type: (.+)" + match = re.search(repo_type_re, content) + if match: + repo_type = match.group(1) + if repo_type not in REPOSITORY_TYPES: + failed.append( + f"Repository type in .nf-core.yml is not valid. " + f"Should be one of {', '.join(REPOSITORY_TYPES)} but was {repo_type}" + ) + else: + passed.append(f"Repository type in .nf-core.yml is valid: {repo_type}") + else: + warned.append("Repository type not set in .nf-core.yml") + else: + ignored.append(".nf-core.yml variable ignored 'repository_type'") + + if "nf_core_version" not in ignore_configs: + # Check that the nf-core version is set in the .nf-core.yml + nf_core_version_re = r"nf_core_version: (.+)" + match = re.search(nf_core_version_re, content) + if match: + nf_core_version = match.group(1) + if nf_core_version != __version__ and "dev" not in __version__: + warned.append( + f"nf-core version in .nf-core.yml is not set to the latest version. " + f"Should be {__version__} but was {nf_core_version}" + ) + else: + passed.append(f"nf-core version in .nf-core.yml is set to the latest version: {nf_core_version}") + else: + warned.append("nf-core version not set in .nf-core.yml") + else: + ignored.append(".nf-core.yml variable ignored 'nf_core_version'") return {"passed": passed, "warned": warned, "failed": failed} diff --git a/tests/lint/nfcore_yml.py b/tests/lint/nfcore_yml.py new file mode 100644 index 0000000000..ea5fa8dee5 --- /dev/null +++ b/tests/lint/nfcore_yml.py @@ -0,0 +1,53 @@ +import re +from pathlib import Path + +import nf_core.create +import nf_core.lint + + +def test_nfcore_yml_pass(self): + """Lint test: nfcore_yml - PASS""" + self.lint_obj._load() + results = self.lint_obj.nfcore_yml() + + assert "Repository type in .nf-core.yml is valid" in str(results["passed"]) + assert "nf-core version in .nf-core.yml is set to the latest version" in str(results["passed"]) + assert len(results.get("warned", [])) == 0 + assert len(results.get("failed", [])) == 0 + assert len(results.get("ignored", [])) == 0 + + +def test_nfcore_yml_fail_repo_type(self): + """Lint test: nfcore_yml - FAIL - repository type not set""" + new_pipeline = self._make_pipeline_copy() + nf_core_yml = Path(new_pipeline) / ".nf-core.yml" + with open(nf_core_yml) as fh: + content = fh.read() + new_content = content.replace("repository_type: pipeline", "repository_type: foo") + with open(nf_core_yml, "w") as fh: + fh.write(new_content) + lint_obj = nf_core.lint.PipelineLint(new_pipeline) + lint_obj._load() + results = lint_obj.nfcore_yml() + assert "Repository type in .nf-core.yml is not valid." in str(results["failed"]) + assert len(results.get("warned", [])) == 0 + assert len(results.get("passed", [])) >= 0 + assert len(results.get("ignored", [])) == 0 + + +def test_nfcore_yml_fail_nfcore_version(self): + """Lint test: nfcore_yml - FAIL - nf-core version not set""" + new_pipeline = self._make_pipeline_copy() + nf_core_yml = Path(new_pipeline) / ".nf-core.yml" + with open(nf_core_yml) as fh: + content = fh.read() + new_content = (re.sub(r"nf-core_version: [\s]*", "nf-core_version: foo", content),) + with open(nf_core_yml, "w") as fh: + fh.write(new_content) + lint_obj = nf_core.lint.PipelineLint(new_pipeline) + lint_obj._load() + results = lint_obj.nfcore_yml() + assert "nf-core version in .nf-core.yml is not set to the latest version." in str(results["warned"]) + assert len(results.get("failed", [])) == 0 + assert len(results.get("passed", [])) >= 0 + assert len(results.get("ignored", [])) == 0 diff --git a/tests/test_lint.py b/tests/test_lint.py index d10cef37e4..0d767dc1db 100644 --- a/tests/test_lint.py +++ b/tests/test_lint.py @@ -233,6 +233,11 @@ def test_sphinx_md_files(self): test_nextflow_config_example_pass, test_nextflow_config_missing_test_profile_failed, ) + from .lint.nfcore_yml import ( # type: ignore[misc] + test_nfcore_yml_fail_nfcore_version, + test_nfcore_yml_fail_repo_type, + test_nfcore_yml_pass, + ) from .lint.template_strings import ( # type: ignore[misc] test_template_strings, test_template_strings_ignore_file, From 907df3bd8d95affb5fc01d90b31c7f45dd1b8582 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Wed, 20 Mar 2024 13:47:36 +0000 Subject: [PATCH 05/11] Update nf-core_version in .nf-core.yml file --- tests/lint/nfcore_yml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lint/nfcore_yml.py b/tests/lint/nfcore_yml.py index ea5fa8dee5..4c36d27c25 100644 --- a/tests/lint/nfcore_yml.py +++ b/tests/lint/nfcore_yml.py @@ -41,7 +41,7 @@ def test_nfcore_yml_fail_nfcore_version(self): nf_core_yml = Path(new_pipeline) / ".nf-core.yml" with open(nf_core_yml) as fh: content = fh.read() - new_content = (re.sub(r"nf-core_version: [\s]*", "nf-core_version: foo", content),) + new_content = re.sub(r"nf-core_version: [\s]*", "nf-core_version: foo", content) with open(nf_core_yml, "w") as fh: fh.write(new_content) lint_obj = nf_core.lint.PipelineLint(new_pipeline) From 0caee7148734c4aa64b361a4ea3d6bfa9b324355 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Wed, 20 Mar 2024 14:41:00 +0000 Subject: [PATCH 06/11] Add nfcore_yml.md for pipeline lint tests --- docs/api/_src/pipeline_lint_tests/nfcore_yml.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 docs/api/_src/pipeline_lint_tests/nfcore_yml.md diff --git a/docs/api/_src/pipeline_lint_tests/nfcore_yml.md b/docs/api/_src/pipeline_lint_tests/nfcore_yml.md new file mode 100644 index 0000000000..f7e797a29c --- /dev/null +++ b/docs/api/_src/pipeline_lint_tests/nfcore_yml.md @@ -0,0 +1,5 @@ +# nfcore_yml + +```{eval-rst} +.. automethod:: nf_core.lint.PipelineLint.nfcore_yml +``` From ebabece0487aea0d38f9f7ac26d7e404161db943 Mon Sep 17 00:00:00 2001 From: Joon-Klaps Date: Wed, 20 Mar 2024 15:38:37 +0000 Subject: [PATCH 07/11] Add logging module and fix nf_core_version regex --- nf_core/lint/nfcore_yml.py | 8 ++++---- tests/lint/nfcore_yml.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/nf_core/lint/nfcore_yml.py b/nf_core/lint/nfcore_yml.py index 6d9f664871..64fefa50b8 100644 --- a/nf_core/lint/nfcore_yml.py +++ b/nf_core/lint/nfcore_yml.py @@ -44,7 +44,7 @@ def nfcore_yml(self): if repo_type not in REPOSITORY_TYPES: failed.append( f"Repository type in .nf-core.yml is not valid. " - f"Should be one of {', '.join(REPOSITORY_TYPES)} but was {repo_type}" + f"Should be one of [{', '.join(REPOSITORY_TYPES)}] but was {repo_type}" ) else: passed.append(f"Repository type in .nf-core.yml is valid: {repo_type}") @@ -58,8 +58,8 @@ def nfcore_yml(self): nf_core_version_re = r"nf_core_version: (.+)" match = re.search(nf_core_version_re, content) if match: - nf_core_version = match.group(1) - if nf_core_version != __version__ and "dev" not in __version__: + nf_core_version = match.group(1).strip('"') + if nf_core_version != __version__ and "dev" not in nf_core_version: warned.append( f"nf-core version in .nf-core.yml is not set to the latest version. " f"Should be {__version__} but was {nf_core_version}" @@ -71,4 +71,4 @@ def nfcore_yml(self): else: ignored.append(".nf-core.yml variable ignored 'nf_core_version'") - return {"passed": passed, "warned": warned, "failed": failed} + return {"passed": passed, "warned": warned, "failed": failed, "ignored": ignored} diff --git a/tests/lint/nfcore_yml.py b/tests/lint/nfcore_yml.py index 4c36d27c25..74d42fe229 100644 --- a/tests/lint/nfcore_yml.py +++ b/tests/lint/nfcore_yml.py @@ -41,7 +41,7 @@ def test_nfcore_yml_fail_nfcore_version(self): nf_core_yml = Path(new_pipeline) / ".nf-core.yml" with open(nf_core_yml) as fh: content = fh.read() - new_content = re.sub(r"nf-core_version: [\s]*", "nf-core_version: foo", content) + new_content = re.sub(r"nf_core_version:.+", "nf_core_version: foo", content) with open(nf_core_yml, "w") as fh: fh.write(new_content) lint_obj = nf_core.lint.PipelineLint(new_pipeline) From 304e41fee50cb817e29568bbf4d442c8f2d6b430 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 21 Mar 2024 19:25:19 +0100 Subject: [PATCH 08/11] use pathlib --- nf_core/lint/nfcore_yml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/nf_core/lint/nfcore_yml.py b/nf_core/lint/nfcore_yml.py index 64fefa50b8..aeae000e05 100644 --- a/nf_core/lint/nfcore_yml.py +++ b/nf_core/lint/nfcore_yml.py @@ -1,5 +1,5 @@ -import os import re +from pathlib import Path from nf_core import __version__ @@ -29,10 +29,10 @@ def nfcore_yml(self): ignore_configs = self.lint_config.get(".nf-core", []) try: - with open(os.path.join(self.wf_path, ".nf-core.yml")) as fh: + with open(Path(self.wf_path, ".nf-core.yml")) as fh: content = fh.read() except FileNotFoundError: - with open(os.path.join(self.wf_path, ".nf-core.yaml")) as fh: + with open(Path(self.wf_path, ".nf-core.yaml")) as fh: content = fh.read() if "repository_type" not in ignore_configs: From 585d591dea93259b9393d6f0c7a39f8a8a3b0780 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 21 Mar 2024 19:28:43 +0100 Subject: [PATCH 09/11] add type hints --- nf_core/lint/nfcore_yml.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nf_core/lint/nfcore_yml.py b/nf_core/lint/nfcore_yml.py index aeae000e05..9f45355e76 100644 --- a/nf_core/lint/nfcore_yml.py +++ b/nf_core/lint/nfcore_yml.py @@ -1,12 +1,13 @@ import re from pathlib import Path +from typing import Dict, List from nf_core import __version__ REPOSITORY_TYPES = ["pipeline", "modules"] -def nfcore_yml(self): +def nfcore_yml(self) -> Dict[str, List[str]]: """Repository ``.nf-core.yml`` tests The ``.nf-core.yml`` contains metadata for nf-core tools to correctly apply its features. @@ -20,10 +21,10 @@ def nfcore_yml(self): * Check if the nf-core version is set to the latest version. """ - passed = [] - warned = [] - failed = [] - ignored = [] + passed: List[str] = [] + warned: List[str] = [] + failed: List[str] = [] + ignored: List[str] = [] # Remove field that should be ignored according to the linting config ignore_configs = self.lint_config.get(".nf-core", []) From e3b0949d7d3bba550513fa634b5760a2a0c34556 Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 21 Mar 2024 19:31:51 +0100 Subject: [PATCH 10/11] fix formatting --- nf_core/lint/nfcore_yml.py | 20 ++++++++++---------- tests/lint/nfcore_yml.py | 6 +++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/nf_core/lint/nfcore_yml.py b/nf_core/lint/nfcore_yml.py index 9f45355e76..f23b2f1a84 100644 --- a/nf_core/lint/nfcore_yml.py +++ b/nf_core/lint/nfcore_yml.py @@ -44,15 +44,15 @@ def nfcore_yml(self) -> Dict[str, List[str]]: repo_type = match.group(1) if repo_type not in REPOSITORY_TYPES: failed.append( - f"Repository type in .nf-core.yml is not valid. " - f"Should be one of [{', '.join(REPOSITORY_TYPES)}] but was {repo_type}" + f"Repository type in `.nf-core.yml` is not valid. " + f"Should be one of `[{', '.join(REPOSITORY_TYPES)}]` but was `{repo_type}`" ) else: - passed.append(f"Repository type in .nf-core.yml is valid: {repo_type}") + passed.append(f"Repository type in `.nf-core.yml` is valid: `{repo_type}`") else: - warned.append("Repository type not set in .nf-core.yml") + warned.append("Repository type not set in `.nf-core.yml`") else: - ignored.append(".nf-core.yml variable ignored 'repository_type'") + ignored.append("`.nf-core.yml` variable ignored 'repository_type'") if "nf_core_version" not in ignore_configs: # Check that the nf-core version is set in the .nf-core.yml @@ -62,14 +62,14 @@ def nfcore_yml(self) -> Dict[str, List[str]]: nf_core_version = match.group(1).strip('"') if nf_core_version != __version__ and "dev" not in nf_core_version: warned.append( - f"nf-core version in .nf-core.yml is not set to the latest version. " - f"Should be {__version__} but was {nf_core_version}" + f"nf-core version in `.nf-core.yml` is not set to the latest version. " + f"Should be `{__version__}` but was `{nf_core_version}`" ) else: - passed.append(f"nf-core version in .nf-core.yml is set to the latest version: {nf_core_version}") + passed.append(f"nf-core version in `.nf-core.yml` is set to the latest version: `{nf_core_version}`") else: - warned.append("nf-core version not set in .nf-core.yml") + warned.append("nf-core version not set in `.nf-core.yml`") else: - ignored.append(".nf-core.yml variable ignored 'nf_core_version'") + ignored.append("`.nf-core.yml` variable ignored 'nf_core_version'") return {"passed": passed, "warned": warned, "failed": failed, "ignored": ignored} diff --git a/tests/lint/nfcore_yml.py b/tests/lint/nfcore_yml.py index 74d42fe229..b75115fea4 100644 --- a/tests/lint/nfcore_yml.py +++ b/tests/lint/nfcore_yml.py @@ -10,8 +10,8 @@ def test_nfcore_yml_pass(self): self.lint_obj._load() results = self.lint_obj.nfcore_yml() - assert "Repository type in .nf-core.yml is valid" in str(results["passed"]) - assert "nf-core version in .nf-core.yml is set to the latest version" in str(results["passed"]) + assert "Repository type in `.nf-core.yml` is valid" in str(results["passed"]) + assert "nf-core version in `.nf-core.yml` is set to the latest version" in str(results["passed"]) assert len(results.get("warned", [])) == 0 assert len(results.get("failed", [])) == 0 assert len(results.get("ignored", [])) == 0 @@ -29,7 +29,7 @@ def test_nfcore_yml_fail_repo_type(self): lint_obj = nf_core.lint.PipelineLint(new_pipeline) lint_obj._load() results = lint_obj.nfcore_yml() - assert "Repository type in .nf-core.yml is not valid." in str(results["failed"]) + assert "Repository type in `.nf-core.yml` is not valid." in str(results["failed"]) assert len(results.get("warned", [])) == 0 assert len(results.get("passed", [])) >= 0 assert len(results.get("ignored", [])) == 0 From 6ec89d842079151f994ec42170454978fe85657d Mon Sep 17 00:00:00 2001 From: mashehu Date: Thu, 21 Mar 2024 21:13:27 +0100 Subject: [PATCH 11/11] fix test --- tests/lint/nfcore_yml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/lint/nfcore_yml.py b/tests/lint/nfcore_yml.py index b75115fea4..474ccd48fc 100644 --- a/tests/lint/nfcore_yml.py +++ b/tests/lint/nfcore_yml.py @@ -47,7 +47,7 @@ def test_nfcore_yml_fail_nfcore_version(self): lint_obj = nf_core.lint.PipelineLint(new_pipeline) lint_obj._load() results = lint_obj.nfcore_yml() - assert "nf-core version in .nf-core.yml is not set to the latest version." in str(results["warned"]) + assert "nf-core version in `.nf-core.yml` is not set to the latest version." in str(results["warned"]) assert len(results.get("failed", [])) == 0 assert len(results.get("passed", [])) >= 0 assert len(results.get("ignored", [])) == 0