-
Notifications
You must be signed in to change notification settings - Fork 193
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
Validate parameters against schema at pipeline runtime #426
Comments
x-ref nf-core/hlatyping#61, which is also working with the |
Updated original issue text for new JSON schema approach. Linting is now in place, so this is ready to go ahead. |
This Java library looks pretty nice for doing validation: https://github.com/everit-org/json-schema Should be able to use Groovy Grape to import dependencies, as done by @apeltzer in eager here. |
If it helps, to access all CLI called params by the user, within nextflow itself, could use log.info("workflow params")
log.info("${params}") to compare against the schema. |
Yup - unexpected params would be great 👍🏻 Need to be a little careful with this as there are quite a lot of genuine reasons for people to specify params which are not in the schema (eg. HPC cluster options etc etc). So can't fail / warn too noisily. Suggestion for this would be to check and hard-fail for params that match core nextflow flags (see #604) and give a quiet warning about others. Could even try to be clever and compare unexpected params against the schema and give a louder warning if it is a close match? NB. that it would be nice to have some way to disable these warnings. Maybe a param?? 😆 |
Okay so I made a draft of a validation check here: Will have to test this much more. And it also depends on parameters being properly specified in the Schema, of course. |
Implemented in #852 |
Now that we have a JSON Schema file describing parameters, we should be able to check that all supplied params are expected and valid (correct variable type, one of allowed choices, matching given regex etc) when a pipeline is launched.
This will likely need to go hand-in-hand with templating and linting for the
nextflow_schema.json
file, as most params are probably still not present there. We may also need one of these files for the shared configs.I made a quick start on a draft function here - will make a PR when it gets a little further, but discussion on the concept is welcome 🤗
The text was updated successfully, but these errors were encountered: