-
Notifications
You must be signed in to change notification settings - Fork 278
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
Add the ability to run custom rules included in a project #19
Conversation
2 similar comments
Hey @pdericson, Nice work! Although the idea of "pluggable rules" looks good, I don't like yamllint automatically loading rules from the current dir. This would allow untrusted sources (example: a pull request on GitHub) to run arbitrary Python code. Maybe a Could you give more details about your use-case? Is the "truthy" rule just an example, or something you really want to lint? |
Hey @adrienverge, I'll rework my PR to make this explicitly opt-in like you suggest. Regarding the "truthy" example - I have been thinking about creating an ansible linter for a while and so this example would be something I'd like to include. |
Hi @pdericson, I can see the use of such a rule! I guess the motivation is to prevent pyyaml from altering YAML source. Because by default, it turns 1: y
2: yes
3: on
4: true
5: True into {
"1": "y",
"2": true,
"3": true,
"4": true,
"5": true
} and y: 1
yes: 2
on: 3
true: 4
True: 5 into {
"y": 1,
"true": 5
} To be honest I don't really like the pluggable rules idea, but I would warmly welcome a |
@adrienverge I agree, so far the only yaml linting idea I have had for ansible is the truthy rule which as you have pointed out can be made generic. I'm going to replace this PR with #22 |
This is a little rough but I figured I'd raise it now to gauge interest.