-
Notifications
You must be signed in to change notification settings - Fork 683
Print warning for unused CLI parameters #4567
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
Comments
Shouldn't it be a hard error? A warning would still allow for kicking off an expensive, time-consuming, and resource-heavy workflow that is being run with incorrect parameters. For example, I changed That's not the result that I wanted. Parameter validation would have prevented this. EDIT: It seems like part of the problem is that params can be used throughout the .nf script without first being registered. For example, I don't actually have to define a default value as
That is to say, parameter validation requires parameter registration. If this strict-mode functionality were to be introduced, it might have to be enabled in the config in order to avoid breaking changes. Ideally, it would validate basic types (e.g. str, int, list of str), and maybe predefined values (e.g. params.env:str=['cpu','gpu'] or params.ram:int=range(4:16)) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
In general, I think it is useful to warn users about unused parameters, because they might actually be the result of undesired typos, for instance
--resume
instead of-resume
. In this case, the warning would help them fix the CLI syntax.Let me talk about both the traditional CLI and CLI v2 (#3600).
I see two main sub-cases so far:
-x
styled runtime parameters)params
of the pipeline being run; if no match, they should give a warning (for CLI v2, there will be the additional early check around them being runtime parameters)The text was updated successfully, but these errors were encountered: