blob: c085ead48c61aa1f47b2728eb94356968744605b [file] [log] [blame]
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +00001[tox]
2basepython = py36
3minversion = 2.5
4skipsdist = true
Fatih Degirmenci232d33b2020-04-21 08:37:15 +00005envlist = ansible-lint, shellcheck, yamllint, docs
6install_command = pip install --force-reinstall {opts} {packages}
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +00007deps = -r{toxinidir}/test-requirements.txt
8
9[testenv:ansible-lint]
Fatih Degirmenci232d33b2020-04-21 08:37:15 +000010description = invoke ansible-lint to analyse Ansible playbooks and roles
11deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +000012whitelist_externals = bash
Fatih Degirmenci232d33b2020-04-21 08:37:15 +000013# TODO (fdegir): upstream bifrost file bootstrap.yml in install-configure-bifrost/file
14# excluded from ansible-lint since we can't fix issues in them and they will disappear
15# one they are fixed in upstream
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +000016commands =
Fatih Degirmenci232d33b2020-04-21 08:37:15 +000017 bash -c "find {toxinidir} -type f -regex '.*.ya?ml' \
18 ! -regex '.*.tox.*\|.*.venv.*' \
19 -print0 | xargs -t -n1 -0 ansible-lint --nocolor"
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +000020
21[testenv:yamllint]
Fatih Degirmenci232d33b2020-04-21 08:37:15 +000022description = invoke yamllint to analyse YAML files
23deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +000024whitelist_externals = bash
25commands =
Fatih Degirmenci232d33b2020-04-21 08:37:15 +000026 bash -c "find {toxinidir} -type f -regex '.*.ya?ml' \
27 ! -regex '.*.tox.*\|.*.venv.*' \
28 -print0 | xargs -t -n1 -0 yamllint --format standard --strict"
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +000029
30[testenv:shellcheck]
Fatih Degirmenci232d33b2020-04-21 08:37:15 +000031description = invoke shellcheck to analyse bash shell scripts
32deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +000033whitelist_externals = bash
34commands =
Fatih Degirmenci232d33b2020-04-21 08:37:15 +000035 bash -c "find {toxinidir} -type f -regex '.*.sh' \
36 ! -regex '.*.tox.*\|.*.venv.*' \
37 -print0 | xargs -t -n1 -0 shellcheck --color=never --source-path={toxinidir} \
Fatih Degirmencifc21e5f2020-01-13 07:58:59 +000038 --external-sources --format=tty"