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