Sorry for the slightly off-topic question, but I'v...
# help
b
Sorry for the slightly off-topic question, but I've just run into a problem with newer versions of nextflow. For some non-nf-core pipelines, I have a few "global" variables in my nextflow.config, e.g.:
Copy code
taskName	= "my_task"
which I then use in e.g. the
params
section by doing something like
"Results_dir/${taskName}/"
or something like that. However, now I get a lot of errors when trying to run my code:
Copy code
Error nextflow.config:3:44: `taskName` is not defined
│   3 | workspace       = "/path/to/folder/benjamin/${taskName}"
ā•°     |                                               ^^^^^^^^
Any idea how to fix that with nextflow
version 26.04.2 build 12216
?
p
It's a bit difficult without seeing the wider context of the code, but you might find the migration docs helpful: https://docs.seqera.io/nextflow/migrations/26-04
Actually this is maybe better: https://docs.seqera.io/nextflow/strict-syntax
b
Thanks
I also just realised this is probably due to v26 moving to strict syntax
šŸ‘šŸ» 1
but I didn't expect unscoped variables in the nextflow.config to be considered a problem
p
Yup, we have an entirely new config parser built from the ground up
One of the main aims has been to make config files, well, config files - and not just arbitrary groovy scripts
You can generally still do all the same stuff though, with a bit of refactoring
See specifically the "Mixing config statements and scripting statements" section of the docs
b
The flexibility of mixing config and script parts is definitely a selling point IMHO
p
Sure - I'm yet to hear of anything (I think) that can't still be done, just within the new config syntax. There should be no loss of functionality.
šŸ‘ 1