Ansible-lint and yamllint #32
Loading…
Reference in New Issue
No description provided.
Delete Branch "linting"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Does not fix all warnings, but gets rid of the purely cosmetic ones.
(roles/accounts/tasks/main.yml)
I ran it and fixed a lot of yamlling warnings about truthy variables, indentation and trailing spaces.
No major changes so okay by me to merge into dev
I used to fix those truthy variables, but @jlecour convinced me that as long as the ansible project itself still uses those thuthy variables in the official documentation (and than ansible-lint does not warn about them), we should keep the truthy variables.
The main reason I run both linters is that yamllint is much faster for me than ansiblelint, meaning I can get faster feedback.
@jdubois caught so many indentation problems that I think I might have a problem with my linter invocation. It might not be running on every file. Did you run the linters against every file individually ? If not, do you mind sharing your shell glob / find function ?
But honestly, since this is separate from ansible-roles, I think we can be consistent and use true / false / null instead of True / yes / False / no / Null, it makes no sense anyway.
IMHO since EvoBSD is separate from ansible-roles, you can go our own way on this project. So let's use true / false / null as suggested by the linters.
I agree with @drustan. And I don't really see the point in keeping to use True / yes / False / no / Null.
@pmarchand, I ran it telling it to scan the entire folder :
I added a ci step so we can get warnings if we forget to lint, but I've yet to finish configuring the webhook so it's not running yet.
Linting is working now, the other warnings are for stuff that isnt purely cosmetic, I suggest we fix in another branch and merge this one.
Ouf, took me a few tries, but I got rid of all the cosmetic markdown and yaml warnings. I'm going to need you guys to reread the diff until I merge this.
I reread the diff, I think it's ok.