modules bump-versions: match nf-core container formatting in main.nf - #4459
Open
asharaali wants to merge 1 commit into
Open
modules bump-versions: match nf-core container formatting in main.nf#4459asharaali wants to merge 1 commit into
asharaali wants to merge 1 commit into
Conversation
mashehu
approved these changes
Sep 1, 2026
`nf-core modules bump-versions` rewrote the container directive with the
ternary operators at column 0 and padding inside `${...}`:
container "${ workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
? 'https://...'
: 'quay.io/...' }"
Every module in nf-core/modules writes the operators at the start of the
indented continuation lines instead, with no padding:
container "${workflow.containerEngine in ['singularity', 'apptainer'] && !task.ext.singularity_pull_docker_container
? 'https://...'
: 'quay.io/...'}"
The cause is the order of the interpolations in `_replace`: `f"? {inner_indent}"`
emits the operator before the indent rather than after it.
This is the formatting undone by hand across 106 files in nf-core/modules#12756,
which is the PR the issue links to.
Adds a regression test asserting the canonical block is what lands in main.nf.
Closes nf-core#4452
Signed-off-by: Ashar Ali <aaa467@njit.edu>
mashehu
force-pushed
the
fix-4452-container-formatting
branch
from
September 1, 2026 19:38
13c98c2 to
673df6b
Compare
Contributor
|
please join the nf-core org via slack to get the CI running. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
nf-core modules bump-versionsrewrites the container directive inmain.nfafter the Wave build, and the block it writes puts the ternary operators at column 0 and pads the inside of${...}:That is the shape nf-core/modules#12756 had to undo by hand across every bumped module.
Everywhere else in nf-core/modules, and in the modules this repo ships in
nf_core/pipeline-template/modules/nf-core/{fastqc,multiqc}/main.nf, the directive reads:update_main_nf_container()innf_core/modules/containers.pybuilds the replacement from an f-string that emits? {inner_indent}where it means{inner_indent}?. Moving the operators behind the indent and dropping the padding inside${...}is the whole change.Verification
tests/modules/test_containers.pydoes not run on my machine:TestModules.setUpbuilds a pipeline throughnextflow config, and nextflow is not installed here. On unmodifieddevall 38 tests in that file error out in setup, so a local pass/fail there would mean nothing either way — the new test is written for CI.What I could check directly, by driving
ModuleContainers.update_main_nf_container()against a temporary modules repo:dev, the rewritten directive is byte-identical to the broken block abovemodules/nf-core/samtools/sort/main.nfon nf-core/modulesmasterruff checkandruff format --checkare clean on both changed files.CHANGELOG
Not touched.
CHANGELOG.mdhas no running dev section since 4.1.0 shipped, and.github/workflows/changelog.pyappends into one that already exists — happy for@nf-core-bot changelogto add the entry once there is a section to add it to, or to add it myself if you would rather pick the version heading now.Fixes #4452