You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
msg=f"Found incompatible custom yamllint configuration ({file}), please either remove the file or edit it to comply with:{nl} - {nl+' - '.join(errors)}.{nl}{nl}Read https://ansible.readthedocs.io/projects/lint/rules/yaml/ for more details regarding why we have these requirements."
# site.yaml
---
- name: Base setup for all nodeshosts: allgather_facts: falsetasks:
- name: Installansible.builtin.package:
name:
- firefox
- 0ad
Or with:
# site.yaml
---
- name: Base setup for all nodeshosts: allgather_facts: falsetasks:
- name: Installansible.builtin.package:
name:
- "firefox"
- 0ad
Desired Behavior
With or without linting errors should both short-circuit to:
$ ansible-lint;printf"\nRC=%d\n"$?ERROR Found incompatible custom yamllint configuration (.yamllint.yml), please either remove the file or edit it to comply with: - comments.min-spaces-from-content must be 1 - comments-indentation must be false - braces.min-spaces-inside must be 0 - octal-values.forbid-implicit-octal must be true - octal-values.forbid-explicit-octal must be true.Read https://ansible.readthedocs.io/projects/lint/rules/yaml/ for more details regarding why we have these requirements. Fix mode will not be available.Failed: <some message about the short-circuit>. Last profile that met the validation criteria was 'production'.RC=3
Actual Behavior
The linter still runs, instead of being skipped as promised.
Without linting errors:
$ ansible-lint;printf"\nRC=%d\n"$?WARNING Found incompatible custom yamllint configuration (.yamllint.yml), please either remove the file or edit it to comply with: - comments.min-spaces-from-content must be 1 - comments-indentation must be false - braces.min-spaces-inside must be 0 - octal-values.forbid-implicit-octal must be true - octal-values.forbid-explicit-octal must be true.Read https://ansible.readthedocs.io/projects/lint/rules/yaml/ for more details regarding why we have these requirements. Fix mode will not be available.Passed: 0 failure(s), 0 warning(s) on 3 files. Last profile that met the validation criteria was 'production'.RC=0
With linting errors:
% ansible-lint;printf"\nRC=%d\n"$?WARNING Found incompatible custom yamllint configuration (.yamllint.yml), please either remove the file or edit it to comply with: - comments.min-spaces-from-content must be 1 - comments-indentation must be false - braces.min-spaces-inside must be 0 - octal-values.forbid-implicit-octal must be true - octal-values.forbid-explicit-octal must be true.Read https://ansible.readthedocs.io/projects/lint/rules/yaml/ for more details regarding why we have these requirements. Fix mode will not be available.WARNING Listing 1 violation(s) that are fatalyaml[quoted-strings]: String value is redundantly quoted with double quotessite.yml:9Read documentation for instructions on how to ignore specific rule violations. Rule Violation Summary count tag profile rule associated tags 1 yaml[quoted-strings] basic formatting, yaml Failed: 1 failure(s), 0 warning(s) on 3 files. Last profile that met the validation criteria was 'min'.RC=2
The text was updated successfully, but these errors were encountered:
Oh I see what happened, the error was demoted to a warning in #415. But #4152 only requested it apply if warn_list: [yaml] or skip_list: [yaml] are set; otherwise it should still be an error.
I didn't set either of those in my test case above. But instead, setting
# .ansible-lintwrite_list:
- all
Gives
$ ansible-lint ERROR Found incompatible custom yamllint configuration (.yamllint.yml), please either remove the file or edit it to comply with: - comments.min-spaces-from-content must be 1 - comments-indentation must be false - braces.min-spaces-inside must be 0 - octal-values.forbid-implicit-octal must be true - octal-values.forbid-explicit-octal must be true.Read https://ansible.readthedocs.io/projects/lint/rules/yaml/ for more details regarding why we have these requirements. Fix mode will not be available.
$ echo$?3
I don't see the connection between write_list and yamllint, they seem totally apart, does anyone have an explanation?
Summary
If
.yamllint
disagrees withansible-lint
, #4139 is supposed to make it quit early with return code 3:ansible-lint/src/ansiblelint/yaml_utils.py
Lines 141 to 143 in 921aa83
ansible-lint/src/ansiblelint/constants.py
Line 33 in 921aa83
but it does not.
Issue Type
OS / ENVIRONMENT
brew
brew
STEPS TO REPRODUCE
Without linting errors:
Or with:
Desired Behavior
With or without linting errors should both short-circuit to:
Actual Behavior
The linter still runs, instead of being skipped as promised.
Without linting errors:
With linting errors:
The text was updated successfully, but these errors were encountered: