Skip to content

Fix strict syntax in utils_* subworkflows#12329

Open
itrujnara wants to merge 9 commits into
nf-core:masterfrom
itrujnara:strict_syntax
Open

Fix strict syntax in utils_* subworkflows#12329
itrujnara wants to merge 9 commits into
nf-core:masterfrom
itrujnara:strict_syntax

Conversation

@itrujnara

Copy link
Copy Markdown
Contributor

Removed names of single outputs in utils_* subworkflows to comply with Nextflow strict syntax. Edited metas to match. This should remove strict syntax warnings in pipelines.

PR checklist

  • This comment contains a description of changes (with reason).
  • Ensure that the test works with either Docker / Singularity. Conda CI tests can be quite flaky:
    • For subworkflows:
      • nf-core subworkflows test <SUBWORKFLOW> --profile docker
      • nf-core subworkflows test <SUBWORKFLOW> --profile singularity
      • nf-core subworkflows test <SUBWORKFLOW> --profile conda

Comment thread subworkflows/nf-core/utils_nextflow_pipeline/meta.yml

emit:
valid_config = valid_config
valid_config

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we needed this for strict syntax a3fb735

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find the documentation for this, but nextflow lint shows a warning if a workflow has a single output and it is named. I have sent the warning message on Slack. I agree with Maxime that this rule should not be there, but that's the way Ben designed it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but in the current way i get the following with nextflow 26.04.4:

Warn  subworkflows/nf-core/utils_nfcore_pipeline/main.nf:16:5: Variable was declared but not used
│  16 |     valid_config = checkConfigProvided()
╰     |     ^^^^^^^^^^^^

Warn  subworkflows/nf-core/utils_nfcore_pipeline/main.nf:20:5: Emit name should be omitted when there is only one emit
│  20 |     valid_config
╰     |     ^^^^^^^^^^^^

that's why I had the previous version

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I must have tested with a wrong version, with 26.04.4 it indeed returns these warnings. According to the docs the version without the extra name is correct. I am puzzled as to how I should write the emit section to avoid complaints from the language server.

@itrujnara itrujnara requested a review from mashehu July 9, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants