blob: dee4f3accf1e95839784151ac71238f6f0399cf1 [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.lambert0daad992021-12-08 10:14:09 +010068 find . -not -path '*/\.*' -name *.failover -exec checkbashisms -f \{\} +
guillaume.lambertf657a812021-12-07 20:21:17 +010069 sh -c "! find . -not -path '*/\.*' -name *.sh -exec grep 'local .*=' \{\} + || exit 2"
guillaume.lambert0daad992021-12-08 10:14:09 +010070 sh -c "! find . -not -path '*/\.*' -name *.failover -exec grep 'local .*=' \{\} + || exit 2"
Guillaume Lambertd8eab712021-03-08 21:49:28 +010071
Guillaume Lambert056b2d42021-02-17 12:09:47 +010072[testenv:autopep8]
Cédric Ollivierd2421502021-09-28 16:26:56 +020073deps =
74 -r{toxinidir}/requirements.txt
75 -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
76 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambert056b2d42021-02-17 12:09:47 +010077commands =
78 autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/
79
80[testenv:pylint]
Cédric Ollivierd2421502021-09-28 16:26:56 +020081deps =
82 -r{toxinidir}/requirements.txt
83 -chttps://git.onap.org/doc/plain/etc/upper-constraints.os.txt
84 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambert056b2d42021-02-17 12:09:47 +010085whitelist_externals = find
86commands =
87 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 \{\} +
88
guillaume.lambert30ec3902021-09-14 12:32:24 +020089[testenv:pre-commit-install]
90basepython = python3
91deps = pre-commit
92commands =
93 pre-commit install
94 pre-commit install --hook-type commit-msg
95
96[testenv:pre-commit-uninstall]
97basepython = python3
98deps = pre-commit
99commands =
100 pre-commit uninstall
101 pre-commit uninstall --hook-type commit-msg
102
103[testenv:pre-commit]
104basepython = python3
105deps = pre-commit
106passenv = HOME
107commands =
108 pre-commit run --all-files --show-diff-on-failure
109 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
110 # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
111 # Its default arguments --passed and --msg-filename are different from CI recommandations.
112 # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
113 # A dedicated gitlint profile for CI is proposed above. Also to behave fine locally, this profile must have access
114 # to the HOME variable so that Gitlint can retrieve Git user settings.