-
Notifications
You must be signed in to change notification settings - Fork 303
Add error check for invalid config #747
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello Yuki,
Thanks for this addition, this is a good idea.
I wonder whether "dict" is the best user-facing word (in "rules should be a dict"), because "dict" seems a Python-specific word to me. But anyway, we can always change it later if needed.
EDIT: We already use "dict" a few lines above (in "invalid config: not a dict") so I guess it's OK.
|
According to the YAML specification, "mapping" seems to be a more appropriate term. The current yamllint documentation uses "mapping" and does not mention "dict." Perhaps all three instances of "dict" in the error message should be changed to "mapping." Line 82 in 79a6b2b
Line 86 in 79a6b2b
Lines 237 to 238 in 79a6b2b
|
Previously, these errors used the word "dict" because it's the common term in the Python world. But the YAML term is rather "mapping". The present commit fixes this wording. This originates from this discussion [^2]. [^1]: https://yaml.org/spec/1.2.2/#3211-nodes [^2]: #747 (review)
Previously, these errors used the word "dict" because it's the common term in the Python world. But the YAML term is rather "mapping". The present commit fixes this wording. This originates from this discussion [^2]. [^1]: https://yaml.org/spec/1.2.2/#3211-nodes [^2]: #747 (review)
|
Thanks for your input @koyuki7w. I agree and I created #751 to address this. |
Previously, these errors used the word "dict" because it's the common term in the Python world. But the YAML term is rather "mapping". The present commit fixes this wording. This originates from this discussion [^2]. [^1]: https://yaml.org/spec/1.2.2/#3211-nodes [^2]: #747 (review)
In the current version, the error message states
TypeError: 'NoneType' object is not iterablewhen the 'rules' in the config file is not a dict (gh-274.) It would be helpful to improve the error message.Additionally, it is for consistency, as other elements(
ignore,locale, etc.) have similar error checks.