-
Notifications
You must be signed in to change notification settings - Fork 39
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
Suggested improvements/alternative to file mode implementation #29
Comments
Thanks for the suggestion @myii! I prefer the comprehensive solution that could be achieved under a new lint ID, which checks for any number with a leading zero (not just file/dir modes), as shown on the Please let me know if you would like to take a stab at a PR, otherwise I will try to make an extra rule for it tonight. |
@roaldnefs Thanks for the quick response. I've got my hands full with SaltStack Formulas at the current time (including rolling out |
@myii We have indeed decided that |
Fantastic! |
Hi, I wonder, with |
The underlying issue here is that numbers beginning with zero are interpreted as octal in YAML.
https://docs.saltstack.com/en/latest/ref/states/all/salt.states.file.html
A useful look is how
yamllint
handles these.https://yamllint.readthedocs.io/en/stable/rules.html#module-yamllint.rules.octal_values
0
, not just file/dir modes.I've done test runs on 45 formulas under the SaltStack Formulas organisation. Many of them fall afoul of both
207
and208
. The problem is that most of these are false positives. The very common usage of 3-digit, unquoted modes (e.g.755
and644
) is completely legitimate. My suggestion is that these shouldn't be flagged as errors/warnings. There's a simple workaround for this for the time being:208
to the ignored listA more comprehensive solution could be achieved under a new lint ID, which checks for any number with a leading zero (not just file/dir modes), as shown on the
yamllint
docs. Then users could add both207
and208
to the ignore list and use the comprehensive octal bug linter instead.The text was updated successfully, but these errors were encountered: