Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
- fix linting with missing input ([#4202](https://github.com/nf-core/tools/pull/4202))
- fix(lint): use correct config key zenodo_doi ([#4201](https://github.com/nf-core/tools/pull/4201))
- add missing lint test documentation and add pre-commit check for them ([#4052](https://github.com/nf-core/tools/pull/4052))
- Allow `prefix2` for the ext keys linting ([#4234](https://github.com/nf-core/tools/pull/4234))

### Modules

Expand Down
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 @@ -320,7 +320,7 @@ def check_script_section(self, lines):
)

# Validate ext keys
permitted_ext_keys = {"ext.args", "ext.prefix", "ext.use_gpu"}
permitted_ext_keys = {"ext.args", "ext.prefix", "ext.prefix2", "ext.use_gpu"}
invalid_ext_keys = [
key
for key in re.findall(r"\bext\.\w+", script)
Expand Down
4 changes: 4 additions & 0 deletions tests/modules/lint/test_main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1025,6 +1025,7 @@ def args = task.ext.args ?: ''
def args2 = task.ext.args2 ?: ''
def args3 = task.ext.args3 ?: ''
def prefix = task.ext.prefix ?: "${meta.id}"
Comment thread
SPPearce marked this conversation as resolved.
def prefix2 = task.ext.prefix2 ?: ''
def use_gpu = task.ext.use_gpu ? '--gpu' : ''
"""
],
Expand All @@ -1047,6 +1048,9 @@ def suffix = task.ext.suffix ?: '.bam'
assert "ext.args1" in mock_lint.failed[0][2]
assert "ext.custom" in mock_lint.failed[0][2]
assert "ext.suffix" in mock_lint.failed[0][2]
assert "ext.prefix1" in mock_lint.failed[0][2]
assert "ext.prefix3" in mock_lint.failed[0][2]
assert "ext.prefix22" in mock_lint.failed[0][2]

# ext.argsN where N >= 2 should be valid
mock_lint.passed, mock_lint.failed = [], []
Expand Down
Loading