tripleo-quickstart/tox.ini
Sorin Sbarnea f0b251d924 Run all linters via pre-commit
Executes all linters via pre-commit, which is much faster, guarantees
their version locking and allows upgrading them with a single command.

Before this change the only linter running via pre-commit was
ansible-lint.

Now we also run bashate, flake8 and yamllint via pre-commit.

For developer convenience we still keep the old tox environments
which allow running a single linter.

Change-Id: Ia0737c50de0f01de8576089d72de8940c16e9e0e
2019-01-15 11:14:31 +00:00

60 lines
1.4 KiB
INI

[tox]
minversion = 2.0
envlist = docs, linters
skipdist = True
[testenv]
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}
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals =
bash
echo
[testenv:bindep]
basepython = python3
# Do not install any requirements. We want this to be fast and work even if
# system dependencies are missing, since it's used to tell you what system
# dependencies are missing! This also means that bindep must be installed
# separately, outside of the requirements files.
deps = bindep
commands = bindep test
[testenv:docs]
basepython = python3
commands = python setup.py build_sphinx
[testenv:bashate]
envdir = {toxworkdir}/linters
commands =
python -m pre_commit run bashate -a
[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
[testenv:releasenotes]
basepython = python3
whitelist_externals = bash
commands = bash -c ci-scripts/releasenotes_tox.sh
[testenv:venv]
changedir = {toxinidir}
commands =
{posargs:echo done}