blob: 7474abe110c6b84fd382df31410958fc688f954a [file] [log] [blame]
Fatih Degirmenci10a35222020-01-13 08:03:37 +00001[tox]
2basepython = py36
3minversion = 2.5
4skipsdist = true
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +00005envlist = ansible-lint, shellcheck, yamllint, docs
6install_command = pip install --force-reinstall {opts} {packages}
Fatih Degirmenci10a35222020-01-13 08:03:37 +00007deps = -r{toxinidir}/test-requirements.txt
8
9[testenv:ansible-lint]
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +000010description = invoke ansible-lint to analyse Ansible playbooks and roles
11deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmenci10a35222020-01-13 08:03:37 +000012whitelist_externals = bash
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +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 Degirmenci10a35222020-01-13 08:03:37 +000016commands =
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +000017 bash -c "find {toxinidir} -type f -regex '.*.ya?ml' \
18 ! -regex '.*install-configure-bifrost/files/bootstrap.yml\|.*.tox.*\|.*.venv.*' \
19 -print0 | xargs -t -n1 -0 ansible-lint --nocolor"
Fatih Degirmenci10a35222020-01-13 08:03:37 +000020
21[testenv:yamllint]
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +000022description = invoke yamllint to analyse YAML files
23deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmenci10a35222020-01-13 08:03:37 +000024whitelist_externals = bash
25commands =
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +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 Degirmenci10a35222020-01-13 08:03:37 +000029
30[testenv:shellcheck]
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +000031description = invoke shellcheck to analyse bash shell scripts
32deps = -r{toxinidir}/test-requirements.txt
Fatih Degirmenci10a35222020-01-13 08:03:37 +000033whitelist_externals = bash
34commands =
Fatih Degirmenci4c8c1082020-04-19 18:26:59 +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 Degirmenci10a35222020-01-13 08:03:37 +000038 --external-sources --format=tty"