-
-
Notifications
You must be signed in to change notification settings - Fork 521
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
tox should crash when an unknown key is used #1121
Comments
I'm opposed to this myself, for multiple reasons, I think this would cause lots of issues:
|
To be fair I don't even think we have a reliable way to find out what option is needed and what's not. We load all in the file (the defined one are post-processed), but some of them might only be accessed by downstream plugins and I don't believe they can at the moment even register new file configs. At minimum we would be looking at a long migration path until the plugins would adopt. I don't think it's worth the effort, so I'll close this unless someone can convince me otherwise by tomorrow. |
I think you misunderstand the issue: It's not about not needed keys, it's about unknown keys. If plugins do not make their keys known in a well defined way yet than this would be something that could be improved. |
But you're right: self defined substitutions would need to be handled also. I don't know if it's worth the effort, but we should at least discuss it. If there is no general solutions, we could maybe catch the most common mistakes, but that would be ugly. If there is no programmatic solution for this then it should be documented clearly that the user can define arbitrary keys and reuse them later, because AFAIK this is not explicitly documented. |
there's no way to 100% classify what's unneeded and what's unknown AFAIK, so I don't think it's doable. yes we should document the substitution part. |
Looking at it again, I am afraid you're right. There is no clean way to do this. I guess it is better to come around to the idea that the way how configuration with Rather than trying to fix it here, we can learn from this and let this flow into the design of #999. If we can agree on this, maybe we should even announce (and add to the (contributor) docs) that new features or major changes in Closing this then and opening issues for what came up here, as it is off-topic here. |
If the user mistypes a key name, they should get appropriate feedback that what they might want to happen will not happen.
One obvious example:
oops - forget the s and the tests are not run.
Error could look something like:
ERROR: unknown key 'command' in testenv 'whatever'
On first look this seems an easy fix. One thing that needs to be kept in mind is that plugins can also add configuration options, so the check needs to happen after the plugins had the chance to do that.
Also: I sincerely hope that nobody uses the existing behaviour to add their own keys to tox testenvs and do something with them in a different tool, but even if it is I would regard this a breaking change triggering major version jump.
The text was updated successfully, but these errors were encountered: