[GLOBAL] Move checkbashisms to a dedicated script
[oom.git] / tox.ini
1 [tox]
2 minversion = 1.6
3 envlist =
4  docs,
5  docs-linkcheck,
6  gitlint,
7  checkbashisms,
8  pre-commit,
9 skipsdist=true
10
11 [doc8]
12 ignore-path-errors=docs/helm-search.txt;D001
13
14 [testenv:doc8]
15 deps =
16     -r{toxinidir}/requirements.txt
17     -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
18     -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
19 commands =
20  - doc8 docs/
21
22 [testenv:docs]
23 deps =
24     -r{toxinidir}/requirements.txt
25     -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
26     -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
27 commands =
28  sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
29
30 [testenv:docs-linkcheck]
31 deps =
32     -r{toxinidir}/requirements.txt
33     -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
34     -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
35 commands = sphinx-build -q -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
36
37 [testenv:spelling]
38 #basepython = python3
39 whitelist_externals = wget
40 deps =
41     -r{toxinidir}/requirements.txt
42     -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
43     -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
44 changedir={toxinidir}/docs
45 commands =
46     wget -nv https://git.onap.org/doc/plain/docs/spelling_wordlist.txt -O spelling_wordlist.txt
47     sphinx-build -b spelling -d {envtmpdir}/doctrees . _build/spelling
48
49 [testenv:gitlint]
50 basepython = python3
51 deps =
52     -r{toxinidir}/requirements.txt
53     -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
54     -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
55 commands =
56   gitlint
57
58 [testenv:checkbashisms]
59 deps =
60 whitelist_externals =
61     {toxinidir}/.ci/check-bashisms.sh
62 commands =
63     {toxinidir}/.ci/check-bashisms.sh
64
65 [testenv:autopep8]
66 deps =
67     -r{toxinidir}/requirements.txt
68     -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
69     -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
70 commands =
71     autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/
72
73 [testenv:pylint]
74 deps =
75     -r{toxinidir}/requirements.txt
76     -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
77     -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
78 whitelist_externals = find
79 commands =
80     find kubernetes/ TOSCA/ docs/ -name *.py -exec pylint --max-line-length=120 --disable=missing-docstring --method-rgx="(([a-z_][a-zA-Z0-9_]{2,})|(_[a-z0-9_]*)|(__[a-zA-Z][a-zA-Z0-9_]+__))$" --variable-rgx="[a-zA-Z_][a-zA-Z0-9_]{1,30}$" --reports=y --score=y  --output-format=colorized  \{\} +
81
82 [testenv:pre-commit-install]
83 basepython = python3
84 deps = pre-commit
85 commands =
86     pre-commit install
87     pre-commit install --hook-type commit-msg
88
89 [testenv:pre-commit-uninstall]
90 basepython = python3
91 deps = pre-commit
92 commands =
93     pre-commit uninstall
94     pre-commit uninstall --hook-type commit-msg
95
96 [testenv:pre-commit]
97 basepython = python3
98 deps = pre-commit
99 passenv = HOME
100 commands =
101     pre-commit run --all-files --show-diff-on-failure
102     pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
103     # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
104     # Its default arguments --passed and --msg-filename are different from CI recommandations.
105     # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
106     # A dedicated gitlint profile for CI is proposed above. Also to behave fine locally, this profile must have access
107     # to the HOME variable so that Gitlint can retrieve Git user settings.