blob: bbd00f85c4deaa85a2a1a99776a41b41916b7642 [file] [log] [blame]
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +01001[tox]
2minversion = 1.6
3envlist =
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +01004 docs,
5 docs-linkcheck,
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +01006 gitlint,
Guillaume Lambert85b14922021-03-12 13:53:18 +01007 checkbashisms,
guillaume.lambert30ec3902021-09-14 12:32:24 +02008 pre-commit,
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +01009skipsdist=true
10
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010011[doc8]
12ignore-path-errors=docs/helm-search.txt;D001
13
14[testenv:doc8]
Cédric Ollivierd2421502021-09-28 16:26:56 +020015deps =
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
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010019commands =
guillaume.lambertf3319a82021-09-26 21:37:50 +020020 - doc8 docs/
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010021
22[testenv:docs]
Cédric Ollivierd2421502021-09-28 16:26:56 +020023deps =
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
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010027commands =
guillaume.lambert91df0d82021-04-24 10:37:53 +020028 sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010029
30[testenv:docs-linkcheck]
Cédric Ollivierd2421502021-09-28 16:26:56 +020031deps =
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
guillaume.lambert91df0d82021-04-24 10:37:53 +020035commands = sphinx-build -q -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010036
Guillaume Lambertb825e912021-02-01 21:22:33 +010037[testenv:spelling]
38#basepython = python3
39whitelist_externals = wget
40deps =
Cédric Ollivierd2421502021-09-28 16:26:56 +020041 -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
Guillaume Lambertb825e912021-02-01 21:22:33 +010044changedir={toxinidir}/docs
45commands =
Guillaume Lambert089ba212021-02-10 11:48:39 +010046 wget -nv https://git.onap.org/doc/plain/docs/spelling_wordlist.txt -O spelling_wordlist.txt
Guillaume Lambertb825e912021-02-01 21:22:33 +010047 sphinx-build -b spelling -d {envtmpdir}/doctrees . _build/spelling
48
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010049[testenv:gitlint]
50basepython = python3
51deps =
Cédric Ollivierd2421502021-09-28 16:26:56 +020052 -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
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010055commands =
56 gitlint
57
Guillaume Lambertd8eab712021-03-08 21:49:28 +010058[testenv:checkbashisms]
59deps =
60whitelist_externals = sh
61 find
62 checkbashisms
63commands =
64 sh -c 'which checkbashisms>/dev/null || sudo yum install devscripts-minimal || sudo apt-get install devscripts \
65 || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | \
66 yum install devscripts-minimal )" >&2 && exit 1)'
Guillaume Lambert85b14922021-03-12 13:53:18 +010067 find . -not -path '*/\.*' -name *.sh -exec checkbashisms \{\} +
Guillaume Lambertd8eab712021-03-08 21:49:28 +010068
Guillaume Lambert056b2d42021-02-17 12:09:47 +010069[testenv:autopep8]
Cédric Ollivierd2421502021-09-28 16:26:56 +020070deps =
71 -r{toxinidir}/requirements.txt
72 -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
73 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambert056b2d42021-02-17 12:09:47 +010074commands =
75 autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/
76
77[testenv:pylint]
Cédric Ollivierd2421502021-09-28 16:26:56 +020078deps =
79 -r{toxinidir}/requirements.txt
80 -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
81 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambert056b2d42021-02-17 12:09:47 +010082whitelist_externals = find
83commands =
84 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 \{\} +
85
guillaume.lambert30ec3902021-09-14 12:32:24 +020086[testenv:pre-commit-install]
87basepython = python3
88deps = pre-commit
89commands =
90 pre-commit install
91 pre-commit install --hook-type commit-msg
92
93[testenv:pre-commit-uninstall]
94basepython = python3
95deps = pre-commit
96commands =
97 pre-commit uninstall
98 pre-commit uninstall --hook-type commit-msg
99
100[testenv:pre-commit]
101basepython = python3
102deps = pre-commit
103passenv = HOME
104commands =
105 pre-commit run --all-files --show-diff-on-failure
106 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
107 # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
108 # Its default arguments --passed and --msg-filename are different from CI recommandations.
109 # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
110 # A dedicated gitlint profile for CI is proposed above. Also to behave fine locally, this profile must have access
111 # to the HOME variable so that Gitlint can retrieve Git user settings.