blob: 337b397a268cae863d4e55e61f70ea701dff5bd0 [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 =
guillaume.lambertd09f3632021-12-10 21:17:30 +010060whitelist_externals =
61 {toxinidir}/.ci/check-bashisms.sh
Guillaume Lambertd8eab712021-03-08 21:49:28 +010062commands =
guillaume.lambertd09f3632021-12-10 21:17:30 +010063 {toxinidir}/.ci/check-bashisms.sh
Guillaume Lambertd8eab712021-03-08 21:49:28 +010064
Guillaume Lambert056b2d42021-02-17 12:09:47 +010065[testenv:autopep8]
Cédric Ollivierd2421502021-09-28 16:26:56 +020066deps =
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
Guillaume Lambert056b2d42021-02-17 12:09:47 +010070commands =
71 autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/
72
73[testenv:pylint]
Cédric Ollivierd2421502021-09-28 16:26:56 +020074deps =
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
Guillaume Lambert056b2d42021-02-17 12:09:47 +010078whitelist_externals = find
79commands =
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
guillaume.lambert30ec3902021-09-14 12:32:24 +020082[testenv:pre-commit-install]
83basepython = python3
84deps = pre-commit
85commands =
86 pre-commit install
87 pre-commit install --hook-type commit-msg
88
89[testenv:pre-commit-uninstall]
90basepython = python3
91deps = pre-commit
92commands =
93 pre-commit uninstall
94 pre-commit uninstall --hook-type commit-msg
95
96[testenv:pre-commit]
97basepython = python3
98deps = pre-commit
99passenv = HOME
100commands =
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.