Fatih Degirmenci | b745b05 | 2020-05-01 07:14:49 +0000 | [diff] [blame] | 1 | [tox] |
| 2 | basepython = py36 |
| 3 | minversion = 2.5 |
| 4 | skipsdist = true |
| 5 | envlist = ansible-lint, shellcheck, yamllint, docs |
| 6 | install_command = pip install --force-reinstall {opts} {packages} |
| 7 | deps = -r{toxinidir}/test-requirements.txt |
| 8 | |
| 9 | [testenv:ansible-lint] |
| 10 | description = invoke ansible-lint to analyse Ansible playbooks and roles |
| 11 | deps = -r{toxinidir}/test-requirements.txt |
| 12 | whitelist_externals = bash |
| 13 | commands = |
| 14 | bash -c "find {toxinidir} -type f -regex '.*.ya?ml' \ |
| 15 | ! -regex '.*heat-template.*\|.*.tox.*\|.*.venv.*' \ |
| 16 | -print0 | xargs -t -n1 -0 ansible-lint --nocolor" |
| 17 | |
| 18 | [testenv:yamllint] |
| 19 | description = invoke yamllint to analyse YAML files |
| 20 | deps = -r{toxinidir}/test-requirements.txt |
| 21 | whitelist_externals = bash |
| 22 | commands = |
| 23 | bash -c "find {toxinidir} -type f -regex '.*.ya?ml' \ |
| 24 | ! -regex '.*.tox.*\|.*.venv.*' \ |
| 25 | -print0 | xargs -t -n1 -0 yamllint --format standard --strict" |
| 26 | |
| 27 | [testenv:shellcheck] |
| 28 | description = invoke shellcheck to analyse bash shell scripts |
| 29 | deps = -r{toxinidir}/test-requirements.txt |
| 30 | whitelist_externals = bash |
| 31 | commands = |
| 32 | bash -c "find {toxinidir} -type f -regex '.*.sh' \ |
| 33 | ! -regex '.*.tox.*\|.*.venv.*' \ |
| 34 | -print0 | xargs -t -n1 -0 shellcheck --color=never --source-path={toxinidir} \ |
| 35 | --external-sources --format=tty" |