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