1554cd0b03
* tox -e validate-jinja * Added to ci-jobs Change-Id: I799ec9e586a96800ee592522a0c1af7bd591ca67
88 lines
2.5 KiB
INI
88 lines
2.5 KiB
INI
[tox]
|
|
minversion = 1.6
|
|
envlist = linters
|
|
skipdist = True
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
install_command = pip install -U {opts} {packages}
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
whitelist_externals = bash
|
|
|
|
[testenv:bindep]
|
|
# 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]
|
|
commands = python setup.py build_sphinx
|
|
|
|
[testenv:bashate]
|
|
commands =
|
|
# Run bashate check for all bash scripts
|
|
# Ignores the following rules:
|
|
# 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)
|
|
bash -c "grep --recursive --binary-files=without-match \
|
|
--files-with-match '^.!.*\(ba\)\?sh$' \
|
|
--exclude-dir .tox \
|
|
--exclude-dir .git \
|
|
{toxinidir} | xargs bashate --error . --verbose --ignore=E006,E040"
|
|
|
|
[testenv:pep8]
|
|
commands =
|
|
# Run hacking/flake8 check for all python files
|
|
bash -c "grep --recursive --binary-files=without-match \
|
|
--files-with-match '^.!.*python$' \
|
|
--exclude-dir .tox \
|
|
--exclude-dir .git \
|
|
--exclude-dir .eggs \
|
|
--exclude-dir *.egg-info \
|
|
--exclude-dir dist \
|
|
--exclude-dir *lib/python* \
|
|
--exclude-dir doc \
|
|
{toxinidir} | xargs flake8 --verbose"
|
|
|
|
[testenv:ansible-lint]
|
|
basepython=python2
|
|
commands =
|
|
bash ci-scripts/ansible-lint.sh
|
|
|
|
[testenv:releasenotes]
|
|
whitelist_externals = bash
|
|
commands = bash -c ci-scripts/releasenotes_tox.sh
|
|
|
|
[testenv:linters]
|
|
commands =
|
|
{[testenv:bashate]commands}
|
|
{[testenv:pep8]commands}
|
|
{[testenv:ansible-lint]commands}
|
|
{[testenv:validate-jinja]commands}
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[flake8]
|
|
# E123, E125 skipped as they are invalid PEP-8.
|
|
# E402 module level import not at top of file
|
|
# E501 line too long
|
|
# F403 'from ansible.module_utils.basic import *' used; unable to detect undefined names
|
|
# H303 No wildcard (*) import
|
|
# H301 one import per line
|
|
# F405 ... may be undefined, or defined from star imports:
|
|
show-source = True
|
|
ignore = E123,E125,E402,E501,F403,H303,H301,F405
|
|
builtins = _
|
|
|
|
[testenv:validate-jinja]
|
|
basepython=python2
|
|
commands =
|
|
python ci-scripts/validate_jinja2.py
|