Simplify linting

Keeps pep8 environment until we will be able to remove it from
zuul templates.

Change-Id: I1e709043bb4be93331d4511b947b181fe2ead8f4
This commit is contained in:
Sorin Sbarnea 2020-03-19 15:36:17 +00:00
parent 3bfa92d751
commit 9ac51dc172
2 changed files with 25 additions and 50 deletions

View File

@ -1,5 +1,4 @@
# this is required for the molecule jobs
ansible
ansi2html
docker
openstacksdk

74
tox.ini
View File

@ -33,6 +33,7 @@ commands = stestr run {posargs}
whitelist_externals =
bash
tox
true
[testenv:bindep]
# Do not install any requirements. We want this to be fast and work even if
@ -42,56 +43,20 @@ whitelist_externals =
deps = bindep
commands = bindep test
[testenv:pep8]
envdir = {toxworkdir}/linters
commands =
python -m pre_commit run flake8 -a
[testenv:ansible-lint]
envdir = {toxworkdir}/linters
deps =
{[testenv:linters]deps}
commands =
bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/tripleo_ansible/roles.galaxy' \
ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml"
python -m pre_commit run ansible-lint -a
[testenv:yamllint]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run yamllint -a
[testenv:bashate]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run bashate -a
[testenv:whitespace]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run trailing-whitespace -a
[testenv:shebangs]
envdir = {toxworkdir}/linters
deps = {[testenv:linters]deps}
commands =
python -m pre_commit run check-executables-have-shebangs -a
[testenv:linters]
skipsdist = True
skip_install = True
sitepackages = False
setenv =
UPPER_CONSTRAINTS_FILE=file:///dev/null
deps =
-r {toxinidir}/requirements.txt
-r {toxinidir}/test-requirements.txt
-r {toxinidir}/molecule-requirements.txt
pre-commit
virtualenv<20 # known to break things
-r {toxinidir}/ansible-requirements.txt
commands =
{[testenv:pep8]commands}
{[testenv:ansible-lint]commands}
{[testenv:bashate]commands}
{[testenv:yamllint]commands}
{[testenv:whitespace]commands}
{[testenv:shebangs]commands}
bash -c "ANSIBLE_ROLES_PATH='{toxinidir}/tripleo_ansible/roles.galaxy' \
ansible-galaxy install -fr {toxinidir}/tripleo_ansible/ansible-role-requirements.yml"
python -m pre_commit run -a
bash -c '{toxinidir}/scripts/detect-broken-symlinks.sh'
[testenv:releasenotes]
@ -116,10 +81,21 @@ ignore = D001
[testenv:venv]
commands = {posargs}
[testenv:pep8]
description = "[deprecated], use linters instead."
deps =
commands = true
skipsdist = True
skip_install = True
sitepackages = False
[testenv:role-addition]
setenv =
UPPER_CONSTRAINTS_FILE=file:///dev/null
basepython = python3
deps=
{[testenv:linters]deps}
deps =
{[testenv:linters]deps}
-r {toxinidir}/molecule-requirements.txt
commands =
bash -c "ansible-playbook -i localhost, role-addition.yml -e role_name=skeleton_test"
bash -c "if (podman ps 2> /dev/null || docker ps 2> /dev/null); then \