blob: c75d0668cf0305ceb734170ca8185e2517c14e8f [file] [log] [blame]
[tox]
basepython = py36
minversion = 2.5
skipsdist = true
envlist = ansible-lint, shellcheck, yamllint, docs
install_command = pip install --force-reinstall {opts} {packages}
deps = -r{toxinidir}/test-requirements.txt
[testenv:ansible-lint]
description = invoke ansible-lint to analyse Ansible playbooks and roles
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = bash
commands =
bash -c "find {toxinidir}/engine -type f -regex '.*.ya?ml' \
-print0 | xargs -t -n1 -0 ansible-lint --nocolor"
[testenv:yamllint]
description = invoke yamllint to analyse YAML files
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = bash
commands =
bash -c "find {toxinidir}/engine -type f -regex '.*.ya?ml' -print0 | \
xargs -t -n1 -0 yamllint --format standard --strict"
[testenv:shellcheck]
description = invoke shellcheck to analyse bash shell scripts
deps = -r{toxinidir}/test-requirements.txt
whitelist_externals = bash
commands =
bash -c "find {toxinidir}/engine -type f -name '*.sh' -print0 | \
xargs -t -n1 -0 shellcheck --color=never --source-path={toxinidir}/engine \
--external-sources --format=tty"
[testenv:docs]
description = invoke sphinx-build to build the HTML docs
deps = -r{toxinidir}/test-requirements.txt
commands = sphinx-build -c "{toxinidir}/docs" -d "{toxinidir}/.docs_doctree" docs "{toxinidir}/.docs_build" --color -W -bhtml {posargs}
python -c 'import pathlib; print("documentation available under file://\{0\}".format(pathlib.Path(r"{toxinidir}") / ".docs_build" / "index.html"))'