Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 1 | [tox] |
| 2 | minversion = 1.6 |
| 3 | envlist = |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 4 | docs, |
| 5 | docs-linkcheck, |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 6 | gitlint, |
Guillaume Lambert | 85b1492 | 2021-03-12 13:53:18 +0100 | [diff] [blame] | 7 | checkbashisms, |
guillaume.lambert | 30ec390 | 2021-09-14 12:32:24 +0200 | [diff] [blame] | 8 | pre-commit, |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 9 | skipsdist=true |
| 10 | |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 11 | [doc8] |
| 12 | ignore-path-errors=docs/helm-search.txt;D001 |
| 13 | |
| 14 | [testenv:doc8] |
| 15 | deps = -rdocs/requirements-docs.txt |
guillaume.lambert | f3319a8 | 2021-09-26 21:37:50 +0200 | [diff] [blame] | 16 | doc8 |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 17 | commands = |
guillaume.lambert | f3319a8 | 2021-09-26 21:37:50 +0200 | [diff] [blame] | 18 | - doc8 docs/ |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 19 | |
| 20 | [testenv:docs] |
| 21 | deps = -rdocs/requirements-docs.txt |
| 22 | commands = |
guillaume.lambert | 91df0d8 | 2021-04-24 10:37:53 +0200 | [diff] [blame] | 23 | sphinx-build -q -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 24 | |
| 25 | [testenv:docs-linkcheck] |
| 26 | deps = -rdocs/requirements-docs.txt |
guillaume.lambert | 91df0d8 | 2021-04-24 10:37:53 +0200 | [diff] [blame] | 27 | commands = sphinx-build -q -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck |
Sylvain Desbureaux | ec07bca | 2020-12-09 10:13:42 +0100 | [diff] [blame] | 28 | |
Guillaume Lambert | b825e91 | 2021-02-01 21:22:33 +0100 | [diff] [blame] | 29 | [testenv:spelling] |
| 30 | #basepython = python3 |
| 31 | whitelist_externals = wget |
| 32 | deps = |
| 33 | -rdocs/requirements-docs.txt |
| 34 | sphinxcontrib-spelling |
| 35 | PyEnchant |
| 36 | changedir={toxinidir}/docs |
| 37 | commands = |
Guillaume Lambert | 089ba21 | 2021-02-10 11:48:39 +0100 | [diff] [blame] | 38 | wget -nv https://git.onap.org/doc/plain/docs/spelling_wordlist.txt -O spelling_wordlist.txt |
Guillaume Lambert | b825e91 | 2021-02-01 21:22:33 +0100 | [diff] [blame] | 39 | sphinx-build -b spelling -d {envtmpdir}/doctrees . _build/spelling |
| 40 | |
Sylvain Desbureaux | 3c393e5 | 2020-12-07 09:15:19 +0100 | [diff] [blame] | 41 | [testenv:gitlint] |
| 42 | basepython = python3 |
| 43 | deps = |
| 44 | gitlint |
| 45 | |
| 46 | commands = |
| 47 | gitlint |
| 48 | |
Guillaume Lambert | d8eab71 | 2021-03-08 21:49:28 +0100 | [diff] [blame] | 49 | [testenv:checkbashisms] |
| 50 | deps = |
| 51 | whitelist_externals = sh |
| 52 | find |
| 53 | checkbashisms |
| 54 | commands = |
| 55 | sh -c 'which checkbashisms>/dev/null || sudo yum install devscripts-minimal || sudo apt-get install devscripts \ |
| 56 | || (echo "checkbashisms command not found - please install it (e.g. sudo apt-get install devscripts | \ |
| 57 | yum install devscripts-minimal )" >&2 && exit 1)' |
Guillaume Lambert | 85b1492 | 2021-03-12 13:53:18 +0100 | [diff] [blame] | 58 | find . -not -path '*/\.*' -name *.sh -exec checkbashisms \{\} + |
Guillaume Lambert | d8eab71 | 2021-03-08 21:49:28 +0100 | [diff] [blame] | 59 | |
Guillaume Lambert | 056b2d4 | 2021-02-17 12:09:47 +0100 | [diff] [blame] | 60 | [testenv:autopep8] |
| 61 | deps = autopep8 |
| 62 | commands = |
| 63 | autopep8 --max-line-length 120 --in-place --recursive kubernetes/ TOSCA/ docs/ |
| 64 | |
| 65 | [testenv:pylint] |
| 66 | deps = pylint |
| 67 | whitelist_externals = find |
| 68 | commands = |
| 69 | 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 \{\} + |
| 70 | |
guillaume.lambert | 30ec390 | 2021-09-14 12:32:24 +0200 | [diff] [blame] | 71 | [testenv:pre-commit-install] |
| 72 | basepython = python3 |
| 73 | deps = pre-commit |
| 74 | commands = |
| 75 | pre-commit install |
| 76 | pre-commit install --hook-type commit-msg |
| 77 | |
| 78 | [testenv:pre-commit-uninstall] |
| 79 | basepython = python3 |
| 80 | deps = pre-commit |
| 81 | commands = |
| 82 | pre-commit uninstall |
| 83 | pre-commit uninstall --hook-type commit-msg |
| 84 | |
| 85 | [testenv:pre-commit] |
| 86 | basepython = python3 |
| 87 | deps = pre-commit |
| 88 | passenv = HOME |
| 89 | commands = |
| 90 | pre-commit run --all-files --show-diff-on-failure |
| 91 | pre-commit run gitlint --hook-stage commit-msg --commit-msg-filename .git/COMMIT_EDITMSG |
| 92 | # Gitlint only proposes a pre-commit configuration for the commit-msg stage but none for the commit stage. |
| 93 | # Its default arguments --passed and --msg-filename are different from CI recommandations. |
| 94 | # As a result, the line above is always skipped in jenkins CI since there cannot be a .git/COMMIT_EDITMSG file. |
| 95 | # A dedicated gitlint profile for CI is proposed above. Also to behave fine locally, this profile must have access |
| 96 | # to the HOME variable so that Gitlint can retrieve Git user settings. |