Thanks to visit codestin.com
Credit goes to github.com

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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- Use the org from .nf-core.yml when linting multiqc_config report_comment ([#3800](https://github.com/nf-core/tools/pull/3800))
- Linting of patched subworkflows ([#3755](https://github.com/nf-core/tools/pull/3755))
- Add link to modules and subworkflows linting error docs ([#3818](https://github.com/nf-core/tools/pull/3818))
- fix ternary container linting ([#3830](https://github.com/nf-core/tools/pull/3830))

### Modules

Expand Down
6 changes: 3 additions & 3 deletions nf_core/modules/lint/main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,11 @@ def check_process_section(self, lines, registry, fix_version, progress_bar):
# Deprecated enable_conda
for i, raw_line in enumerate(lines):
url = None
line = raw_line.strip(" \n'\"}:")
line = raw_line.strip(" \n'\"}:?")

# Catch preceding "container "
if line.startswith("container"):
line = line.replace("container", "").strip(" \n'\"}:")
line = line.replace("container", "").strip(" \n'\"}:?")

if _container_type(line) == "conda":
if "bioconda::" in line:
Expand Down Expand Up @@ -592,7 +592,7 @@ def check_process_labels(self, lines):
def check_container_link_line(self, raw_line, registry):
"""Look for common problems in the container name / URL, for docker and singularity."""

line = raw_line.strip(" \n'\"}:")
line = raw_line.strip(" \n'\"}:?")

# lint double quotes
if line.count('"') > 2:
Expand Down
9 changes: 9 additions & 0 deletions tests/modules/lint/test_main_nf.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ def test_process_labels(content, passed, warned, failed):
0,
1,
),
# Ternary with ? on next line (new Nextflow format) should pass
(
'''container "${workflow.containerEngine == 'singularity' && !task.ext.singularity_pull_docker_container
? 'https://community-cr-prod.seqera.io/docker/registry/v2/blobs/sha256/c2/c262fc09eca59edb5a724080eeceb00fb06396f510aefb229c2d2c6897e63975/data'
: 'community.wave.seqera.io/library/coreutils:9.5--ae99c88a9b28c264'}"''',
6,
0,
0,
),
],
)
def test_container_links(content, passed, warned, failed):
Expand Down