blob: ca5c71b98ed83915f835a94336c8c78d9619be72 [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 Ollivier92cdf222022-08-31 22:01:39 +020015basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020016deps =
17 -r{toxinidir}/requirements.txt
Cédric Ollivier92cdf222022-08-31 22:01:39 +020018 -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
Cédric Ollivierd2421502021-09-28 16:26:56 +020019 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010020commands =
guillaume.lambertf3319a82021-09-26 21:37:50 +020021 - doc8 docs/
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010022
23[testenv:docs]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020024basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020025deps =
26 -r{toxinidir}/requirements.txt
Cédric Ollivier92cdf222022-08-31 22:01:39 +020027 -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
Cédric Ollivierd2421502021-09-28 16:26:56 +020028 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010029commands =
guillaume.lambert91df0d82021-04-24 10:37:53 +020030 sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010031
32[testenv:docs-linkcheck]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020033basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020034deps =
35 -r{toxinidir}/requirements.txt
Cédric Ollivier92cdf222022-08-31 22:01:39 +020036 -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
Cédric Ollivierd2421502021-09-28 16:26:56 +020037 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
guillaume.lambert91df0d82021-04-24 10:37:53 +020038commands = sphinx-build -q -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010039
Guillaume Lambertb825e912021-02-01 21:22:33 +010040[testenv:spelling]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020041basepython = python3.8
Matthew Watkins465aee02023-04-05 11:01:07 +010042allowlist_externals = wget
Guillaume Lambertb825e912021-02-01 21:22:33 +010043deps =
Cédric Ollivierd2421502021-09-28 16:26:56 +020044 -r{toxinidir}/requirements.txt
Cédric Ollivier92cdf222022-08-31 22:01:39 +020045 -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
Cédric Ollivierd2421502021-09-28 16:26:56 +020046 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambertb825e912021-02-01 21:22:33 +010047changedir={toxinidir}/docs
48commands =
Guillaume Lambert089ba212021-02-10 11:48:39 +010049 wget -nv https://git.onap.org/doc/plain/docs/spelling_wordlist.txt -O spelling_wordlist.txt
Guillaume Lambertb825e912021-02-01 21:22:33 +010050 sphinx-build -b spelling -d {envtmpdir}/doctrees . _build/spelling
51
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010052[testenv:gitlint]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020053basepython = python3.8
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010054deps =
Cédric Ollivierd2421502021-09-28 16:26:56 +020055 -r{toxinidir}/requirements.txt
Cédric Ollivier92cdf222022-08-31 22:01:39 +020056 -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
Cédric Ollivierd2421502021-09-28 16:26:56 +020057 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010058commands =
59 gitlint
60
Guillaume Lambertd8eab712021-03-08 21:49:28 +010061[testenv:checkbashisms]
62deps =
Matthew Watkins465aee02023-04-05 11:01:07 +010063allowlist_externals =
guillaume.lambertd09f3632021-12-10 21:17:30 +010064 {toxinidir}/.ci/check-bashisms.sh
Guillaume Lambertd8eab712021-03-08 21:49:28 +010065commands =
guillaume.lambertd09f3632021-12-10 21:17:30 +010066 {toxinidir}/.ci/check-bashisms.sh
Guillaume Lambertd8eab712021-03-08 21:49:28 +010067
guillaume.lambert73f34592021-12-10 20:26:19 +010068[testenv:shellcheck]
69basepython = python3
70deps = shellcheck-py
Matthew Watkins465aee02023-04-05 11:01:07 +010071allowlist_externals = find
guillaume.lambert73f34592021-12-10 20:26:19 +010072commands =
73 find . -not -path '*/\.*' -name *.sh -exec shellcheck \{\} +
74
Guillaume Lambert056b2d42021-02-17 12:09:47 +010075[testenv:autopep8]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020076basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020077deps =
78 -r{toxinidir}/requirements.txt
Cédric Ollivier92cdf222022-08-31 22:01:39 +020079 -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
Cédric Ollivierd2421502021-09-28 16:26:56 +020080 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambert056b2d42021-02-17 12:09:47 +010081commands =
82 autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/
83
84[testenv:pylint]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020085basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020086deps =
87 -r{toxinidir}/requirements.txt
Cédric Ollivier92cdf222022-08-31 22:01:39 +020088 -chttps://raw.githubusercontent.com/openstack/requirements/stable/yoga/upper-constraints.txt
Cédric Ollivierd2421502021-09-28 16:26:56 +020089 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Matthew Watkins465aee02023-04-05 11:01:07 +010090allowlist_externals = find
Guillaume Lambert056b2d42021-02-17 12:09:47 +010091commands =
92 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 \{\} +
93
guillaume.lambert30ec3902021-09-14 12:32:24 +020094[testenv:pre-commit-install]
95basepython = python3
96deps = pre-commit
97commands =
98 pre-commit install
99 pre-commit install --hook-type commit-msg
100
101[testenv:pre-commit-uninstall]
102basepython = python3
103deps = pre-commit
104commands =
105 pre-commit uninstall
106 pre-commit uninstall --hook-type commit-msg
107
108[testenv:pre-commit]
109basepython = python3
110deps = pre-commit
111passenv = HOME
112commands =
113 pre-commit run --all-files --show-diff-on-failure
114 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
115 # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
116 # Its default arguments --passed and --msg-filename are different from CI recommandations.
117 # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
118 # A dedicated gitlint profile for CI is proposed above. Also to behave fine locally, this profile must have access
119 # to the HOME variable so that Gitlint can retrieve Git user settings.
guillaume.lambert296fa7f2021-12-10 20:28:24 +0100120
121[testenv:pre-commit-autoupdate]
122basepython = python3
123deps = pre-commit
124commands =
125 pre-commit autoupdate