Formatting
The key words “MUST”, “MUST NOT”, “SHOULD”, etc. are to be interpreted as described in RFC 2119.
1 Nextflow syntax formatting
To maintain code quality and prevent issues, all code MUST be free of Nextflow warnings and errors.
Utilize the following command to check your code:
NXF_SYNTAX_PARSER=v2 nextflow lint modules/nf-core/module_nameNote
The version two the of Nextflow strict syntax will be made default in Nextflow v26.04.
Common issues within nf-core components to avoid:
| Old syntax | Prefered syntax |
|---|---|
Unused def args = task.ext.args ?: '' in stub | Delete the variable definition in the stub block |
Undeclared variable my_variable | Specify def before the variable: def my_variable |
input.collect{ it[1].name } | Specify a variable name: input.collect{ meta, file -> file.name } |
for loop | Use the .each operator: .each{} operator |
2 General module code formatting
All code SHOULD otherwise be aligned to follow the ‘Harshil Alignment™️’ format, if it does not violate the Nextflow strict syntax specifications.