Skip to content

Update to nextflow strict syntax #872

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 28, 2025
Merged

Conversation

d4straub
Copy link
Collaborator

@d4straub d4straub commented Apr 17, 2025

Nextflow is changing eventually to stricter syntax, described in https://www.nextflow.io/docs/latest/strict-syntax.html. This PR solves all errors (but not warnings) regarding this strict syntax for Nextflow extension for Visual Studio Code, version 1.2.0.
Following this stricter syntax allows using the full potential of the Nextflow language support plugin and it should make the pipeline code (more) future proof.

Specific changes:

  • all local modules had their when statement removed (this causes most of the file changed here)
  • for loops were replaced with .each
  • .anyMatch was replaced with .any
  • all variables had a def added
  • switch was replaced by if/else (only in nf-core module vsearch/usearchglobal ) via Update vsearch/usearchglobal to strict syntax modules#8333
  • workflows/ampliseq.nf had the params & channel creation moved into workflow
  • Implicit closure parameter it was added as it -> in all local workflows and subworkflows [this is not causing an error, but it alone is deprecated]

There are no functional changes whatsoever in this PR, only syntax improvements.

PR checklist

  • This comment contains a description of changes (with reason).
  • If you've fixed a bug or added code that should be tested, add tests!
  • If you've added a new tool - have you followed the pipeline conventions in the contribution docs
  • If necessary, also make a PR on the nf-core/ampliseq branch on the nf-core/test-datasets repository.
  • Make sure your code lints (nf-core pipelines lint).
  • Ensure the test suite passes (nextflow run . -profile test,docker --outdir <OUTDIR>).
  • Check for unexpected warnings in debug mode (nextflow run . -profile debug,test,docker --outdir <OUTDIR>).
  • Usage Documentation in docs/usage.md is updated.
  • Output Documentation in docs/output.md is updated.
  • CHANGELOG.md is updated.
  • README.md is updated (including new tool citations and authors/contributors).

@d4straub
Copy link
Collaborator Author

@nf-core-bot fix linting

@d4straub
Copy link
Collaborator Author

Unfortunately all latest-everything tests are expected to fail because nf-schema 2.3.0 is not compatible with the most recent nextflow edge release.

@d4straub d4straub marked this pull request as ready for review April 25, 2025 08:57
Copy link
Member

@ggabernet ggabernet left a comment

Choose a reason for hiding this comment

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

Looks good to me

@ggabernet
Copy link
Member

ggabernet commented Apr 25, 2025

Unfortunately all latest-everything tests are expected to fail because nf-schema 2.3.0 is not compatible with the most recent nextflow edge release.

The fix is to downgreat [email protected] to [email protected] in the nextflow.config for now

@d4straub
Copy link
Collaborator Author

Thanks!
Yes, I will downgrade nf-schema in a separate PR.

@d4straub d4straub merged commit 3e4c213 into nf-core:dev Apr 28, 2025
18 of 32 checks passed
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.

3 participants