-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
57 lines (54 loc) · 1.53 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
[tox]
minversion = 1.6
envlist =
molecule,
pre-commit,
lint
skipsdist=true
[testenv:molecule]
basepython = python3
deps =
ansible
docker
molecule
molecule-docker
passenv = *
commands =
./molecule.sh
allowlist_externals =
./molecule.sh
[testenv:pre-commit]
allowlist_externals =
/bin/sh
deps = pre-commit
passenv = HOME
commands =
pre-commit run --all-files --show-diff-on-failure
/bin/sh -c 'if ! git config --get user.name > /dev/null; then \
git config --global --add user.name "CI"; \
touch .git/REMOVE_USERNAME; fi'
/bin/sh -c 'if ! git config --get user.email > /dev/null; then \
git config --global --add user.email "[email protected]"; \
touch .git/REMOVE_USEREMAIL; fi'
/bin/sh -c "if [ -f .git/COMMIT_EDITMSG ]; then \
cp .git/COMMIT_EDITMSG .git/COMMIT_MSGTOX; else \
git log HEAD -n1 | tail -n +5 | cut -c 5- > .git/COMMIT_MSGTOX; fi"
pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_MSGTOX
/bin/sh -c "rm -f .git/COMMIT_MSGTOX"
/bin/sh -c "if [ -f .git/REMOVE_USERNAME ]; then \
git config --global --unset user.name; \
rm -f .git/REMOVE_USERNAME; fi"
/bin/sh -c "if [ -f .git/REMOVE_USEREMAIL ]; then \
git config --global --unset user.email; \
rm -f .git/REMOVE_USEREMAIL; fi"
[testenv:lint]
basepython = python310
deps =
ansible-lint
yamllint
commands =
/bin/bash -c "ansible-lint tasks/*.yml"
yamllint .
allowlist_externals =
/bin/bash
yamllint