-
Notifications
You must be signed in to change notification settings - Fork 673
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
--fix
incompatible with yamllint max line-length
#4233
Comments
This seems to be related to #4118. |
For additional information, I noticed today that the Ansible lint yaml documentation makes the following recommendation:
I'd agree with this statement except for when it is not applicable to a long line that cannot have spaces in them (such as a URL) and therefore invalidates the use of Block Scalars. |
Possible duplicate of #4039. I don’t understand why that was closed. |
An example would be URL created using facts. You cannot have spaces since it's URL. And since facts are not words, you cannot exclude such strings in yamlint using |
Summary
ansible-lint --fix
does not respect the maximum yaml line length in a repo where the line length is specified in a .yamllint file and multi-line strings use double quotes with a \ to wrap onto the next line.When running
ansible-lint --fix
twice, the double quotes and line split are removed on the first pass, followed by a line-length error on the second pass.Issue Type
OS / ENVIRONMENT
MacOS Sonoma 14.5
STEPS TO REPRODUCE
A minimum test repo contains two files:
.yamllint
file:and 2) a
roles/arole/tasks/main.yml
file:Then run
ansible-lint --fix
twice.Desired Behavior
I expected the multi-line string to be ignored since the a fix might combined the multiline string into a single line thereby surpassing the max line length limit.
Actual Behavior
The second iteration of running
ansible-lint --fix
returns the following line too long error, even though it was fine before running ansible-lint:The text was updated successfully, but these errors were encountered: