summaryrefslogtreecommitdiff
path: root/tox.ini
blob: 03ba7dc47c1e2a456d27cb5aca79bd140816ddfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
[tox]
minversion = 1.4.2
envlist = docs,linters
skipsdist = True

[testenv]
deps = -r{toxinidir}/requirements.txt
       -r{toxinidir}/test-requirements.txt

[testenv:docs]
commands = python setup.py build_sphinx

[testenv:venv]
commands = {posargs}

[flake8]
# E123, E125 skipped as they are invalid PEP-8.

show-source = True
ignore = E123,E125
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build

[testenv:linters]
setenv =
  ANSIBLE_ROLES_PATH = ..
whitelist_externals = bash
commands =
  # PEP8 Lint Check
  flake8
  # Ansible Lint Check
  bash -c "find . -not -path '*/\.*' -type f -regex '.*.y[a]?ml' -print0 | \
    xargs -t -n1 -0 ansible-lint"
  # Ansible Syntax Check
  bash -c "find tests -type f -regex '.*.y[a]?ml' -print | xargs -t -n1 \
    ansible-playbook --syntax-check -i tests/inventory \
    -e rolename=$(basename $(pwd)) > /dev/null"