Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ def main_nf(
("main_nf", "main_nf_version_topic", "Module emits software versions as topic", module.main_nf)
)
else:
module.warned.append(
module.failed.append(
("main_nf", "main_nf_version_topic", "Module does not emit software versions as topic", module.main_nf)
)

Expand Down
34 changes: 0 additions & 34 deletions nf_core/subworkflows/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,22 +106,6 @@ def main_nf(_, subworkflow: NFCoreComponent) -> tuple[list[str], list[str]]:
# Check the main definition
check_main_section(subworkflow, main_lines, included_components)

# Check that a software version is emitted
if outputs:
if "versions" in outputs:
subworkflow.passed.append(
("main_nf", "main_nf_version_emitted", "Subworkflow emits software version", subworkflow.main_nf)
)
else:
subworkflow.warned.append(
(
"main_nf",
"main_nf_version_emitted",
"Subworkflow does not emit software version. Can be ignored if the subworkflow is using topic channels",
subworkflow.main_nf,
)
)

return inputs, outputs


Expand Down Expand Up @@ -167,24 +151,6 @@ def check_main_section(self, lines, included_components):
self.main_nf,
)
)
if component + ".out.versions" in script:
self.passed.append(
(
"main_nf",
"main_nf_include_versions",
f"Included component '{component}' versions are added in main.nf",
self.main_nf,
)
)
else:
self.warned.append(
(
"main_nf",
"main_nf_include_versions",
f"Included component '{component}' versions are not added in main.nf. Can be ignored if the module is using topic channels",
self.main_nf,
)
)


def check_subworkflow_section(self, lines: list[str]) -> list[str]:
Expand Down
18 changes: 0 additions & 18 deletions nf_core/subworkflows/lint/subworkflow_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,24 +219,6 @@ def subworkflow_tests(_, subworkflow: NFCoreComponent, allow_missing: bool = Fal
snap_file,
)
)
if "versions" in str(snap_content[test_name]) or "versions" in str(snap_content.keys()):
subworkflow.passed.append(
(
"subworkflow_tests",
"test_snap_versions",
"versions found in snapshot file",
snap_file,
)
)
else:
subworkflow.warned.append(
(
"subworkflow_tests",
"test_snap_versions",
"versions not found in snapshot file. Can be ignored if the subworkflow is using topic channels",
snap_file,
)
)
except json.decoder.JSONDecodeError as e:
subworkflow.failed.append(
(
Expand Down
5 changes: 2 additions & 3 deletions tests/modules/lint/test_main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ def test_topics_and_emits_version_check(self):
directory=self.pipeline_dir, remote_url=GITLAB_URL, branch=GITLAB_NFTEST_BRANCH
)
module_lint.lint(print_results=False, module="fastqc")
assert len(module_lint.failed) == 0, f"Linting failed with {[x.__dict__ for x in module_lint.failed]}"
assert any(w.lint_test in ("main_nf_version_emit", "main_nf_version_topic") for w in module_lint.warned), (
f"Expected warning about missing version topic, got {[w.message for w in module_lint.warned]}"
assert any(f.lint_test in ("main_nf_version_emit", "main_nf_version_topic") for f in module_lint.failed), (
f"Expected failure about missing version topic, got {[f.message for f in module_lint.failed]}"
)
assert len(module_lint.passed) > 0

Expand Down
2 changes: 1 addition & 1 deletion tests/modules/lint/test_module_lint_remotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_modules_lint_gitlab_modules(self):
self.mods_install_gitlab.install("multiqc")
module_lint = nf_core.modules.lint.ModuleLint(directory=self.pipeline_dir, remote_url=GITLAB_URL)
module_lint.lint(print_results=False, all_modules=True)
assert len(module_lint.failed) == 2
assert len(module_lint.failed) == 3
assert len(module_lint.passed) > 0
assert len(module_lint.warned) >= 0

Expand Down
11 changes: 6 additions & 5 deletions tests/modules/lint/test_module_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,15 @@ def test_nftest_failing_linting(self):
Repo.clone_from(GITLAB_URL, self.nfcore_modules, branch=GITLAB_NFTEST_BRANCH)

module_lint = nf_core.modules.lint.ModuleLint(directory=self.nfcore_modules)
module_lint.lint(print_results=False, module="kallisto/quant")
module_lint.lint(print_results=True, module="kallisto/quant")

assert len(module_lint.failed) == 2, f"Linting failed with {[x.__dict__ for x in module_lint.failed]}"
assert len(module_lint.failed) == 3, f"Linting failed with {[x.__dict__ for x in module_lint.failed]}"
assert len(module_lint.passed) >= 0
assert len(module_lint.warned) >= 0
assert module_lint.failed[0].lint_test == "meta_yml_valid"
assert module_lint.failed[1].lint_test == "test_main_tags"
assert "kallisto/index" in module_lint.failed[1].message
assert module_lint.failed[0].lint_test == "main_nf_version_topic"
assert module_lint.failed[1].lint_test == "meta_yml_valid"
assert module_lint.failed[2].lint_test == "test_main_tags"
assert "kallisto/index" in module_lint.failed[2].message

def test_modules_absent_version(self):
"""Test linting a nf-test module if the versions is absent in the snapshot file `"""
Expand Down
2 changes: 1 addition & 1 deletion tests/modules/lint/test_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ def test_modules_lint_patched_modules(self):
all_modules=True,
)

assert len(module_lint.failed) == 1, f"Linting failed with {[x.__dict__ for x in module_lint.failed]}"
assert len(module_lint.failed) == 2, f"Linting failed with {[x.__dict__ for x in module_lint.failed]}"
assert len(module_lint.passed) > 0
assert len(module_lint.warned) >= 0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading