Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add command nf-core subworkflows lint #2379

Merged
merged 16 commits into from
Jul 26, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
handle error when subworkflow does not include any components
  • Loading branch information
mirpedrol committed Jul 26, 2023

Verified

This commit was signed with the committer’s verified signature.
KyleFromNVIDIA Kyle Edwards
commit ac5c58702430315845d54545338e007fa420dcef
50 changes: 27 additions & 23 deletions nf_core/subworkflows/lint/main_nf.py
Original file line number Diff line number Diff line change
@@ -120,32 +120,36 @@ def check_main_section(self, lines, included_components):

# Check that all included components are used
# Check that all included component versions are used
main_nf_include_used = True
main_nf_include_versions = True
for component in included_components:
if component not in script:
self.warned.append(
(
"main_nf_include_used",
f"Not all included components are used in main.nf",
self.main_nf,
main_nf_include_used = False
main_nf_include_versions = False
if included_components is not None:
for component in included_components:
if component in script:
self.passed.append(
("main_nf_include_used", f"All included components are used in main.nf", self.main_nf)
)
)
main_nf_include_used = False
if component + ".out.versions" not in script:
self.warned.append(
(
"main_nf_include_versions",
f"Not all included component versions are added in main.nf",
self.main_nf,
main_nf_include_used = True
if component + ".out.versions" not in script:
self.passed.append(
("main_nf_include_versions", f"All included component versions are added in main.nf", self.main_nf)
)
main_nf_include_versions = True

if not main_nf_include_used:
self.warned.append(
(
"main_nf_include_used",
f"Not all included components are used in main.nf",
self.main_nf,
)
)
if not main_nf_include_versions:
self.warned.append(
(
"main_nf_include_versions",
f"Not all included component versions are added in main.nf",
self.main_nf,
)
main_nf_include_versions = False
if main_nf_include_used:
self.passed.append(("main_nf_include_used", f"All included components are used in main.nf", self.main_nf))
if main_nf_include_versions:
self.passed.append(
("main_nf_include_versions", f"All included component versions are added in main.nf", self.main_nf)
)