-
Notifications
You must be signed in to change notification settings - Fork 674
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
ansible-lint should be able to generate comments that match it's own rules #3890
Comments
This is more of a missing feature as in ability to use the value configured inside
A PR to improve the linter formatting ability would be welcomed here, but I do not think that the team will have the time to implement this change. |
My .yamllint file doesn't mention min-spaces-from-content:
It's possible I've got another config file around somewhere, but I'm not sure where
|
I noticed that the ansible-lint includes it's own yamllint config. The |
Summary
This is potentially better reported as 2 issues, and I'll happily split it, but the two are tightly coupled...
As mentioned in #3839 the default behaviour of
ansible-lint --fix
results in comments preceded with just a single space, while the linter wants 2. This in turn means that while fixing one issue it causes a new issue. What adds to the confusion is that the run which re-writes the yaml returns success and 0 errors, while a second run returns the violation.While I understand the desire to support compatibility with prettier, this results in broken default behaviour. Which is very confusing for the user.
Either:
--fix
adds 1 or 2 spaces based on the user's preference, preferably with a default that matches the default linting behaviourHowever, at the very least
ansible-lint
should be honestly report that the file it generated does not meet its own rules.Issue Type
OS / ENVIRONMENT
ansible installed with git
ansible-lint installed using pip
STEPS TO REPRODUCE
Desired Behavior
Output of second
ansible-lint
call should result in 0 errors and 0 changesActual Behavior
Output of first
ansible-lint --fix
call reports 0 errors, but 1 changeRe-running
ansible-lint --fix
reports 1 violation and 0 changes:The text was updated successfully, but these errors were encountered: