Merge "pre-commit: Integrate doc8 and bandit"

This commit is contained in:
Zuul 2024-02-21 06:00:36 +00:00 committed by Gerrit Code Review
commit f425dd1222
3 changed files with 20 additions and 19 deletions

View File

@ -23,3 +23,13 @@ repos:
hooks:
- id: hacking
additional_dependencies: []
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
hooks:
- id: bandit
args: ['-x', 'tests']
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
hooks:
- id: doc8

View File

@ -1,14 +1,6 @@
fixtures>=3.0.0 # Apache-2.0/BSD
hacking>=6.1.0,<6.2.0 # Apache-2.0
oslotest>=3.2.0 # Apache-2.0
requests>=2.14.2 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
doc8>=0.6.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
# Bandit security code scanner
bandit>=1.7.0,<1.8.0 # Apache-2.0
pre-commit>=2.6.0 # MIT

21
tox.ini
View File

@ -1,6 +1,6 @@
[tox]
minversion = 3.2.0
envlist = py3,pep8,bandit
envlist = py3,pep8
[testenv]
setenv =
@ -9,7 +9,6 @@ setenv =
CLIENT_NAME=oslo.service
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
allowlist_externals = find
@ -18,10 +17,10 @@ commands =
stestr run --slowest {posargs}
[testenv:pep8]
deps =
pre-commit
commands =
pre-commit run -a
bandit -r oslo_service -n5 -x tests
doc8 --ignore-path "doc/source/history.rst" doc/source
[testenv:venv]
commands = {posargs}
@ -29,6 +28,10 @@ commands = {posargs}
[testenv:docs]
allowlist_externals =
rm
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
fixtures>=3.0.0 # Apache-2.0/BSD
commands =
rm -rf doc/build
sphinx-build -W --keep-going -b html doc/source doc/build/html {posargs}
@ -58,16 +61,12 @@ import_exceptions = oslo_service._i18n
[testenv:debug]
commands = oslo_debug_helper -t oslo_service/tests {posargs}
[testenv:bandit]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/requirements.txt
commands = bandit -r oslo_service -n5 -x tests {posargs}
[testenv:releasenotes]
allowlist_externals =
rm
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html