-
Notifications
You must be signed in to change notification settings - Fork 6
/
tox.ini
59 lines (54 loc) · 3.3 KB
/
tox.ini
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[tox]
minversion = 2.3.1
skipsdist = True
envlist = ansible-lint,any-errors-fatal
[testenv:ansible-lint]
# ANSIBLE0002: Trailing whitespace
# There should not be any trailing whitespace
# ANSIBLE0004: Git checkouts must contain explicit version
# All version control checkouts must point to an explicit commit or tag, not just "latest"
# ANSIBLE0005: Mercurial checkouts must contain explicit revision
# All version control checkouts must point to an explicit commit or tag, not just "latest"
# ANSIBLE0006: Using command rather than module
# Executing a command when there is an Ansible module is generally a bad idea
# ANSIBLE0007: Using command rather than an argument to e.g. file
# Executing a command when there is are arguments to modules is generally a bad idea
# ANSIBLE0008: Deprecated sudo
# Instead of sudo/sudo_user, use become/become_user.
# ANSIBLE0009: Octal file permissions must contain leading zero
# Numeric file permissions without leading zero can behavein unexpected ways. See http://docs.ansible.com/ansible/file_module.html
# ANSIBLE0010: Package installs should not use latest
# Package installs should use state=present with or without a version
# ANSIBLE0011: All tasks should be named
# All tasks should have a distinct name for readability and for --start-at-task to work
# ANSIBLE0012: Commands should not change things if nothing needs doing
# Commands should either read information (and thus set changed_when) or not do something
# if it has already been done (using creates/removes) or only do it if another check has a particular result (when)
# ANSIBLE0013: Use shell only when shell functionality is required
# Shell should only be used when piping, redirecting or chaining commands (and Ansible would be preferred for some of those!)
# ANSIBLE0014: Environment variables don't work as part of command
# Environment variables should be passed to shell or command through environment argument
# ANSIBLE0015: Using bare variables is deprecated
# Using bare variables is deprecated. Update yourplaybooks so that the environment value uses the full variablesyntax ("{{your_variable}}").
# ANSIBLE0016: Tasks that run when changed should likely be handlers
# If a task has a `when: result.changed` setting, it's effectively acting as a handler
# ANSIBLE0017: become_user requires become to work as expected
# become_user without become will not actually change user
usedevelop = False
skip_install = True
deps = -rtest-requirements.txt
# both ansible-lint and yamllint use a single tox env to improve build speed and
# reduce disk space. Both are sharing lots of common requirements and most
# time is spend installing dependencies.
setenv =
VIRTUALENV_NO_DOWNLOAD=1
ANSIBLE_CONFIG={toxinidir}/ansible.cfg.example
SKIPPED = ANSIBLE0006,ANSIBLE0007,ANSIBLE0010,ANSIBLE0011,ANSIBLE0012,ANSIBLE0016
commands =
bash -c "git ls-tree --full-tree --name-only -r HEAD plugins | grep -E '\.ya?ml$' | xargs python -m yamllint"
bash -c "git ls-tree --full-tree --name-only -r HEAD plugins | grep -E '\.ya?ml$' | xargs -I FILE -n1 -P 4 ansible-lint --force-color -q -p -x $SKIPPED FILE"
[testenv:any-errors-fatal]
deps = PyYAML
skip_install = True
usedevelop = False
commands = bash -c "git ls-tree --full-tree --name-only -r HEAD plugins | grep -E '\.ya?ml$' | ./tox-check-any_errors_fatal.py -v -"