fixed and bumped linters

- avoids ansible-lint installation bug
- bumps linters to their current versions
- adds missing passenv which prevented run with SSL proxies
- removes tox environments to ease maintenance, user can use posargs
  to run a single linter (hook).

Bug: https://bugs.launchpad.net/tripleo/+bug/1848512
Change-Id: I7657bb829a2928a8310c1758e6934b2f2ddef5c9
This commit is contained in:
Sorin Sbarnea 2019-10-29 10:53:09 +00:00
parent 589486e4f2
commit 75ee474fe1
3 changed files with 13 additions and 23 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.eggs
.tox

View File

@ -1,7 +1,7 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
rev: v2.4.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
@ -14,14 +14,14 @@ repos:
- id: check-yaml
files: .*\.(yaml|yml)$
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.15.0
rev: v1.18.0
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict -f parsable
- repo: https://github.com/ansible/ansible-lint
rev: v4.1.0a0
- repo: https://github.com/ansible/ansible-lint.git
rev: v4.1.1a2
hooks:
- id: ansible-lint
files: \.(yaml|yml)$

26
tox.ini
View File

@ -7,6 +7,12 @@ skipdist = True
usedevelop = True
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
passenv =
CURL_CA_BUNDLE
REQUESTS_CA_BUNDLE
SSH_AUTH_SOCK
SSL_CERT_FILE
TERM
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = bash
@ -19,34 +25,16 @@ basepython = python3
deps = bindep
commands = bindep test
[testenv:pep8]
envdir = {toxworkdir}/linters
commands =
python -m pre_commit run flake8 -a
[testenv:ansible-lint]
setenv =
ANSIBLE_LIBRARY=./library
envdir = {toxworkdir}/linters
commands =
python -m pre_commit run ansible-lint -a
[testenv:linters]
basepython = python3
commands =
# check only modified files:
python -m pre_commit run -a
python -m pre_commit run {posargs} -a
[testenv:releasenotes]
basepython = python3
whitelist_externals = bash
commands = bash -c ci-scripts/releasenotes_tox.sh
[testenv:bashate]
envdir = {toxworkdir}/linters
commands =
python -m pre_commit run bashate -a
[testenv:venv]
basepython = python3
commands = {posargs}