Enable progressive mode with ansible-lint

Makes use of newer feature which produces failures only when current
commit is adding new violations, exiting ones being considered
as already known.

To prove it works, it also removes the E208 from warn, making it
an error. Still, the final linting result is a success because
these violations were already present before current commit.

Change-Id: Ia858f2a3e71d9634e9d90e890d82714105e8f8c9
This commit is contained in:
Sorin Sbarnea 2020-10-31 17:44:18 +00:00 committed by Albin Vass
parent 90d263941a
commit 3febd1423a
4 changed files with 4 additions and 7 deletions

View File

@ -5,13 +5,8 @@ quiet: false
skip_list:
- '106' # Role name does not match ``^[a-z][a-z0-9_]+$`` pattern
- '204' # Lines should be no longer than 160 chars
# TODO(AJaeger): E208 gives false positives currently, we
# should enable it once all issues in zuul-jobs and
# ansible-lint are fixed.
- '301' # Commands should not change things if nothing needs doing
- '701' # No 'galaxy_info' found
warn_list:
- '208' # File permissions not mentioned
rulesdir:
- ./.rules/
use_default_rules: true

1
.gitignore vendored
View File

@ -13,3 +13,4 @@ doc/build
AUTHORS
ChangeLog
dist
.cache

View File

@ -2,4 +2,4 @@
# conflict, like ansible version required by ansible-lint.
flake8
yamllint>=1.23.0
ansible-lint>=4.3.4,<5
ansible-lint>=4.3.7,<5

View File

@ -48,7 +48,7 @@ commands =
flake8 {posargs}
yamllint -s -f parsable .
python -m ansiblelint --version
python -m ansiblelint {env:ANSIBLELINT_OPTS:}
python -m ansiblelint {env:ANSIBLELINT_OPTS:--progressive}
# Ansible Syntax Check
bash -c "find playbooks -type f -regex '.*.ya?ml' ! -regex '.*vars\/.*' -exec \
ansible-playbook --syntax-check -i {toxinidir}/tests/inventory \{\} + > /dev/null"
@ -70,6 +70,7 @@ commands = {posargs}
ignore = E124,E125,E129,E252,E402,E741,W503,W504,H
show-source = True
exclude =
.cache,
.venv,
.tox,
dist,