Skip to content

Commit

Permalink
Merge pull request #2383 from mirpedrol/subworkflows-lint
Browse files Browse the repository at this point in the history
Some modifications in subworkflows lint
  • Loading branch information
mirpedrol authored Jul 27, 2023
2 parents 5eb9752 + 5ea3b08 commit ab34a79
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/api/_src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ This documentation is for the `nf-core/tools` package.

- [Pipeline code lint tests](pipeline_lint_tests/index.md) (run by `nf-core lint`)
- [Module code lint tests](module_lint_tests/index.md) (run by `nf-core modules lint`)
- [Subworkflow code lint tests](subworkflow_lint_test/index.mf) (run by `nf-core subworkflows lint`)
- [nf-core/tools Python package API reference](api/index.md)
- {ref}`genindex`
- {ref}`modindex`
9 changes: 9 additions & 0 deletions docs/api/_src/subworkflow_lint_tests/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Subworkflow lint tests

```{toctree}
:caption: 'Tests:'
:glob: true
:maxdepth: 2
*
```
5 changes: 5 additions & 0 deletions docs/api/_src/subworkflow_lint_tests/main_nf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# main_nf

```{eval-rst}
.. automethod:: nf_core.subworkflows.lint.SubworkflowLint.main_nf
```
5 changes: 5 additions & 0 deletions docs/api/_src/subworkflow_lint_tests/meta_yml.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# meta_yml

```{eval-rst}
.. automethod:: nf_core.subworkflows.lint.SubworkflowLint.meta_yml
```
5 changes: 5 additions & 0 deletions docs/api/_src/subworkflow_lint_tests/module_changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# module_changes

```{eval-rst}
.. automethod:: nf_core.subworkflows.lint.SubworkflowLint.module_changes
```
5 changes: 5 additions & 0 deletions docs/api/_src/subworkflow_lint_tests/module_tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# module_tests

```{eval-rst}
.. automethod:: nf_core.subworkflows.lint.SubworkflowLint.module_tests
```
5 changes: 5 additions & 0 deletions docs/api/_src/subworkflow_lint_tests/module_todos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# module_todos

```{eval-rst}
.. automethod:: nf_core.subworkflows.lint.SubworkflowLint.module_todos
```
5 changes: 5 additions & 0 deletions docs/api/_src/subworkflow_lint_tests/module_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# module_version

```{eval-rst}
.. automethod:: nf_core.subworkflows.lint.SubworkflowLint.module_version
```
22 changes: 19 additions & 3 deletions nf_core/subworkflows/lint/meta_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ def meta_yml(subworkflow_lint_object, subworkflow):
included_components = (
included_components[0] + included_components[1]
) # join included modules and included subworkflows in a single list
if "modules" in meta_yaml:
meta_components = [x for x in meta_yaml["modules"]]
for component in included_components:
if "components" in meta_yaml:
meta_components = [x for x in meta_yaml["components"]]
for component in set(included_components):
if component in meta_components:
subworkflow.passed.append(
(
Expand All @@ -114,3 +114,19 @@ def meta_yml(subworkflow_lint_object, subworkflow):
subworkflow.meta_yml,
)
)
if "modules" in meta_yaml:
subworkflow.failed.append(
(
"meta_modules_deprecated",
f"Deprecated section 'modules' found in `meta.yml`, use 'components' instead",
subworkflow.meta_yml,
)
)
else:
subworkflow.failed.append(
(
"meta_modules_deprecated",
f"Deprecated section 'modules' not found in `meta.yml`",
subworkflow.meta_yml,
)
)
2 changes: 1 addition & 1 deletion nf_core/subworkflows/lint/subworkflow_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def subworkflow_tests(_, subworkflow):
subworkflow, subworkflow.component_dir
)
for test in test_yml:
for component in included_components:
for component in set(included_components):
if component in test["tags"]:
subworkflow.passed.append(
(
Expand Down

0 comments on commit ab34a79

Please sign in to comment.