- Use recommended flake8 setup in pre-commit
- Removes use of hacking as pre-commit provides the lock-in
- Bumps flake8 to latest stable
- Resolves two ignored rules
Change-Id: I98f382cd2b72345748e40106624c73039e0f0f2c
* Kept old specific linter tox targets for backwards compatibility,
so developer can easily run a single linter if desired.
* Reused tox linters virtualenvs to avoid wasting space
* Moved linter config to their official location which enables
developer to call them in any way he wants (like his IDE)
* Updates yamllint to its newer version which supports strict
* Fixed yamllint errors
* Used parsable output format on yamllint which is more consistent
with other tools, being also recognized by IDEs and terminals.
Change-Id: I2bd44feb0a221dcd6f5402e070cf38b31fd8ac97
Depends-On: https://review.openstack.org/#/c/621930/
Story: https://tree.taiga.io/project/tripleo-ci-board/task/381
- adopts official syntax for 'when:' commands
- assures we use current linter which spots when errors
- reverts temporary linter rule disablement
- use parsable output (pep8 like) for ansible-lint
Change-Id: I6eb5719841c2f264e1efed4bf38726f71c840e36
Closes-Bug: #1797838
As discussed in the related bug this is currently blocking master
t-q-e gate.
Change-Id: I8f85ed0a409d01fab7b54953c7980a1a10560951
Related-Bug: #1797838
When using pipes in ansible shell module we can miss the error
because shell is executing without pipefail by default.
This rule will check every shell module if it has "set -e pipefail"
and will fail in case if not.
It excludes tasks which have 'ignore_errors: true' or register
variables.
Change-Id: I394c72040d62dff76180aeb9d703bb8a212bcc98
This patch fixes lint issues that ansible-lint.sh did let pass and it enables
the verbose mode to see what happens.
Change-Id: Id912ecb4000a4cfeb8a4b8ab631774fd7ea5a449
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
- According to the ansible-lint documentation, we can pass a role directory as
an argument. But due to https://github.com/willthames/ansible-lint/issues/210,
the role directory has to contain a trailing slash!
- This patch fixes the following ansible-lint rules:
* ANSIBLE0004: Git checkouts must contain explicit version
* ANSIBLE0008: Deprecated sudo
* ANSIBLE0011: All tasks should be named
* ANSIBLE0014: Environment variables don't work as part of command
* ANSIBLE0015: Using bare variables is deprecated
- Temporarily skipping the following ansible-lint rules (Fixes will be part of
others patches):
* ANSIBLE0007: Using command rather than an argument to e.g file
We have a lot of 'rm' command and we should use file module instead
* ANSIBLE0012: Commands should not change things if nothing needs doing
* ANSIBLE0013: Use Shell only when shell functionality is required
Change-Id: I3d5591ea9fd1691e8115d7093db87781a08a6082
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
This will now run bashate on all shell scripts. We could ignore the
following list of bashate errors:
- E006: Line longer than 79 columns (as many scripts use jinja
templating, this is very difficult)
- E040: Syntax error determined using `bash -n` (as many scripts
use jinja templating, this will often fail and the syntax
error will be discovered in execution anyway)
Change-Id: I6f6d454ac54a0ac98d8b8a092fa522cba092a592
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
Also fix ansible-lint errors and disable flake8 checks on the files
within the roles until we fix them.
Change-Id: Iab40c0fea517b2f74b91cab7b0f443de89e453b8