Merge "pre-commit: Integrate bandit"

This commit is contained in:
Zuul 2024-02-08 13:39:33 +00:00 committed by Gerrit Code Review
commit 62e416b295
3 changed files with 6 additions and 9 deletions

View File

@ -23,3 +23,8 @@ repos:
hooks: hooks:
- id: hacking - id: hacking
additional_dependencies: [] additional_dependencies: []
- repo: https://github.com/PyCQA/bandit
rev: 1.7.6
hooks:
- id: bandit
args: ['-x', 'tests', '-s', 'B314,B405']

View File

@ -7,8 +7,3 @@ eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT
greenlet>=0.4.15 # MIT greenlet>=0.4.15 # MIT
coverage!=4.4,>=4.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

View File

@ -13,12 +13,9 @@ commands = stestr run --slowest {posargs}
[testenv:pep8] [testenv:pep8]
deps = deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master} pre-commit
-r{toxinidir}/test-requirements.txt
commands = commands =
pre-commit run -a pre-commit run -a
# Run security linter
bandit -r oslo_reports tests -n5 --skip B314,B405
[testenv:venv] [testenv:venv]
commands = {posargs} commands = {posargs}