nextflow-io / nf-validation

Params validation plugin for Nextflow pipelines
https://nextflow-io.github.io/nf-validation/
Apache License 2.0
48 stars 19 forks source link

Warning for undefined parameter `help` #151

Closed mateuszpawlik closed 6 months ago

mateuszpawlik commented 9 months ago

With Nextflow 23.10.1 I get the following warning:

WARN: Access to undefined parameter `help` -- Initialise it to a default value eg. `params.help = some_value`

Where and how should I initialize help parameter?

nvnieuwk commented 9 months ago

Simply adding params.help = some_value to your nextflow.config file should do the trick :)

mateuszpawlik commented 9 months ago

This actually triggers the help message without executing the pipeline or an error.

Setting params.help = "bla" causes ERROR ~ Specified param 'bla' does not exist in JSON schema.

Setting params.help = 42 cases printing the help message.

nvnieuwk commented 9 months ago

Huh, that's weird. That's not supposed to happen... @mirpedrol do you know what could be causing this?

mirpedrol commented 9 months ago

It should be initialized as false params.help = false, otherwise it will be interpreted as true, and this show the help message. You may also need to add this parameter to the nextflow schema to avoid the does not exist in JSON schema error.

mateuszpawlik commented 9 months ago

I added params.help = false separately to my other params { ... } The warning is gone and it didn't complain that it is not in the schema.