blob: 253cb6b423c0350a53f9141bb8266119f2a11eb1 [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
Andreas Geissleree7e3ad2024-02-28 14:30:53 +010018 -chttps://releases.openstack.org/constraints/upper/yoga
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
Andreas Geissleree7e3ad2024-02-28 14:30:53 +010027 -chttps://releases.openstack.org/constraints/upper/yoga
Cédric Ollivierd2421502021-09-28 16:26:56 +020028 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Andreas Geissler691906d2023-09-25 10:57:56 +020029allowlist_externals = sudo
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010030commands =
Andreas Geissler691906d2023-09-25 10:57:56 +020031 sudo apt install graphviz
32 sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010033
34[testenv:docs-linkcheck]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020035basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020036deps =
37 -r{toxinidir}/requirements.txt
Andreas Geissleree7e3ad2024-02-28 14:30:53 +010038 -chttps://releases.openstack.org/constraints/upper/yoga
Cédric Ollivierd2421502021-09-28 16:26:56 +020039 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Andreas Geissler691906d2023-09-25 10:57:56 +020040allowlist_externals = sudo
41commands =
42 sudo apt install graphviz
43 sphinx-build -q -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
Sylvain Desbureauxec07bca2020-12-09 10:13:42 +010044
Guillaume Lambertb825e912021-02-01 21:22:33 +010045[testenv:spelling]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020046basepython = python3.8
Andreas Geissler691906d2023-09-25 10:57:56 +020047allowlist_externals =
48 wget
49 sudo
Guillaume Lambertb825e912021-02-01 21:22:33 +010050deps =
Cédric Ollivierd2421502021-09-28 16:26:56 +020051 -r{toxinidir}/requirements.txt
Andreas Geissleree7e3ad2024-02-28 14:30:53 +010052 -chttps://releases.openstack.org/constraints/upper/yoga
Cédric Ollivierd2421502021-09-28 16:26:56 +020053 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambertb825e912021-02-01 21:22:33 +010054changedir={toxinidir}/docs
55commands =
Andreas Geissler691906d2023-09-25 10:57:56 +020056 sudo apt install graphviz
Guillaume Lambert089ba212021-02-10 11:48:39 +010057 wget -nv https://git.onap.org/doc/plain/docs/spelling_wordlist.txt -O spelling_wordlist.txt
Guillaume Lambertb825e912021-02-01 21:22:33 +010058 sphinx-build -b spelling -d {envtmpdir}/doctrees . _build/spelling
59
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010060[testenv:gitlint]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020061basepython = python3.8
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010062deps =
Cédric Ollivierd2421502021-09-28 16:26:56 +020063 -r{toxinidir}/requirements.txt
Andreas Geissleree7e3ad2024-02-28 14:30:53 +010064 -chttps://releases.openstack.org/constraints/upper/yoga
Cédric Ollivierd2421502021-09-28 16:26:56 +020065 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Sylvain Desbureaux3c393e52020-12-07 09:15:19 +010066commands =
67 gitlint
68
Guillaume Lambertd8eab712021-03-08 21:49:28 +010069[testenv:checkbashisms]
70deps =
Matthew Watkins465aee02023-04-05 11:01:07 +010071allowlist_externals =
guillaume.lambertd09f3632021-12-10 21:17:30 +010072 {toxinidir}/.ci/check-bashisms.sh
Guillaume Lambertd8eab712021-03-08 21:49:28 +010073commands =
guillaume.lambertd09f3632021-12-10 21:17:30 +010074 {toxinidir}/.ci/check-bashisms.sh
Guillaume Lambertd8eab712021-03-08 21:49:28 +010075
guillaume.lambert73f34592021-12-10 20:26:19 +010076[testenv:shellcheck]
77basepython = python3
78deps = shellcheck-py
Matthew Watkins465aee02023-04-05 11:01:07 +010079allowlist_externals = find
guillaume.lambert73f34592021-12-10 20:26:19 +010080commands =
81 find . -not -path '*/\.*' -name *.sh -exec shellcheck \{\} +
82
Guillaume Lambert056b2d42021-02-17 12:09:47 +010083[testenv:autopep8]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020084basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020085deps =
86 -r{toxinidir}/requirements.txt
Andreas Geissleree7e3ad2024-02-28 14:30:53 +010087 -chttps://releases.openstack.org/constraints/upper/yoga
Cédric Ollivierd2421502021-09-28 16:26:56 +020088 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Guillaume Lambert056b2d42021-02-17 12:09:47 +010089commands =
90 autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/
91
92[testenv:pylint]
Cédric Ollivier92cdf222022-08-31 22:01:39 +020093basepython = python3.8
Cédric Ollivierd2421502021-09-28 16:26:56 +020094deps =
95 -r{toxinidir}/requirements.txt
Andreas Geissleree7e3ad2024-02-28 14:30:53 +010096 -chttps://releases.openstack.org/constraints/upper/yoga
Cédric Ollivierd2421502021-09-28 16:26:56 +020097 -chttps://git.onap.org/doc/plain/etc/upper-constraints.onap.txt
Matthew Watkins465aee02023-04-05 11:01:07 +010098allowlist_externals = find
Guillaume Lambert056b2d42021-02-17 12:09:47 +010099commands =
100 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 \{\} +
101
guillaume.lambert30ec3902021-09-14 12:32:24 +0200102[testenv:pre-commit-install]
103basepython = python3
104deps = pre-commit
105commands =
106 pre-commit install
107 pre-commit install --hook-type commit-msg
108
109[testenv:pre-commit-uninstall]
110basepython = python3
111deps = pre-commit
112commands =
113 pre-commit uninstall
114 pre-commit uninstall --hook-type commit-msg
115
116[testenv:pre-commit]
117basepython = python3
118deps = pre-commit
119passenv = HOME
120commands =
121 pre-commit run --all-files --show-diff-on-failure
122 pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG
123 # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage.
124 # Its default arguments --passed and --msg-filename are different from CI recommandations.
125 # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file.
126 # A dedicated gitlint profile for CI is proposed above. Also to behave fine locally, this profile must have access
127 # to the HOME variable so that Gitlint can retrieve Git user settings.
guillaume.lambert296fa7f2021-12-10 20:28:24 +0100128
129[testenv:pre-commit-autoupdate]
130basepython = python3
131deps = pre-commit
132commands =
133 pre-commit autoupdate