-
Notifications
You must be signed in to change notification settings - Fork 13
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
warn when providing unsupported options in the config file? #11
Comments
Sorry for the late answer. I fully agree with you that this should not (and indeed can not) be the responsibility of the configuration provider. I've looked into this and Click's architecture makes it extremely difficult to implement this.
It then populates The problem here is that at the moment of invocation the Callback can not know which options will be invoked by Click. It merely injects the default values and relies on Click to do the right thing afterwards. This also leads to inconsistent handling of the I suppose you could argue that it is Click's responsibility to check |
There might be a chance to fix this after pallets/click#590 is addressed. |
Hello, just want to voice my support for a change in this direction, as it caused a bug for me today. It does make sense that a change may be required on Click's part. It might make sense to say as much over there. |
FTR, I just added strict configuration validation to |
As of now, making a typo in the configuration file (e.g. resulting in a wrong key name) results in the setting being silently ignored. It would be very useful to be warned about this.
One may think that validating the config file should be the role of the configuration provider but in reality the configuration provider may just be a parser of the file format, reused by several click config file options (for different click commands).
I.e. it would be nice if the click option could let the configuration provider know which configuration settings it expects (or handle the validation itself).
Haven't looked into how easy it is to get this from click.
The text was updated successfully, but these errors were encountered: