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:
parent
589486e4f2
commit
75ee474fe1
|
@ -0,0 +1,2 @@
|
||||||
|
.eggs
|
||||||
|
.tox
|
|
@ -1,7 +1,7 @@
|
||||||
---
|
---
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v2.1.0
|
rev: v2.4.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
|
@ -14,14 +14,14 @@ repos:
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
files: .*\.(yaml|yml)$
|
files: .*\.(yaml|yml)$
|
||||||
- repo: https://github.com/adrienverge/yamllint.git
|
- repo: https://github.com/adrienverge/yamllint.git
|
||||||
rev: v1.15.0
|
rev: v1.18.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
files: \.(yaml|yml)$
|
files: \.(yaml|yml)$
|
||||||
types: [file, yaml]
|
types: [file, yaml]
|
||||||
entry: yamllint --strict -f parsable
|
entry: yamllint --strict -f parsable
|
||||||
- repo: https://github.com/ansible/ansible-lint
|
- repo: https://github.com/ansible/ansible-lint.git
|
||||||
rev: v4.1.0a0
|
rev: v4.1.1a2
|
||||||
hooks:
|
hooks:
|
||||||
- id: ansible-lint
|
- id: ansible-lint
|
||||||
files: \.(yaml|yml)$
|
files: \.(yaml|yml)$
|
||||||
|
|
26
tox.ini
26
tox.ini
|
@ -7,6 +7,12 @@ skipdist = True
|
||||||
usedevelop = 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}
|
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}
|
setenv = VIRTUAL_ENV={envdir}
|
||||||
|
passenv =
|
||||||
|
CURL_CA_BUNDLE
|
||||||
|
REQUESTS_CA_BUNDLE
|
||||||
|
SSH_AUTH_SOCK
|
||||||
|
SSL_CERT_FILE
|
||||||
|
TERM
|
||||||
deps = -r{toxinidir}/test-requirements.txt
|
deps = -r{toxinidir}/test-requirements.txt
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
|
|
||||||
|
@ -19,34 +25,16 @@ basepython = python3
|
||||||
deps = bindep
|
deps = bindep
|
||||||
commands = bindep test
|
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]
|
[testenv:linters]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
commands =
|
commands =
|
||||||
# check only modified files:
|
python -m pre_commit run {posargs} -a
|
||||||
python -m pre_commit run -a
|
|
||||||
|
|
||||||
[testenv:releasenotes]
|
[testenv:releasenotes]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
whitelist_externals = bash
|
whitelist_externals = bash
|
||||||
commands = bash -c ci-scripts/releasenotes_tox.sh
|
commands = bash -c ci-scripts/releasenotes_tox.sh
|
||||||
|
|
||||||
[testenv:bashate]
|
|
||||||
envdir = {toxworkdir}/linters
|
|
||||||
commands =
|
|
||||||
python -m pre_commit run bashate -a
|
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
basepython = python3
|
basepython = python3
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
|
|
Loading…
Reference in New Issue