pre-commit: Integrate bandit
We also remove these unnecessary linter dependencies from test-requirements.txt. The independent bandit target was removed because it's integrated to the pep8 target. Co-Authored-By: Stephen Finucane <sfinucan@redhat.com> Change-Id: I0c9ca1f9310820c83667bffa2d1287d3daffccbc
This commit is contained in:
parent
2eb7a9fe62
commit
619d312a18
@ -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']
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
hacking>=6.1.0,<6.2.0 # Apache-2.0
|
|
||||||
|
|
||||||
eventlet>=0.18.2,!=0.18.3,!=0.20.1,!=0.21.0,!=0.23.0 # MIT
|
eventlet>=0.18.2,!=0.18.3,!=0.20.1,!=0.21.0,!=0.23.0 # MIT
|
||||||
fixtures>=3.0.0 # Apache-2.0/BSD
|
fixtures>=3.0.0 # Apache-2.0/BSD
|
||||||
testscenarios>=0.4 # Apache-2.0/BSD
|
testscenarios>=0.4 # Apache-2.0/BSD
|
||||||
@ -15,8 +13,3 @@ coverage!=4.4,>=4.0 # Apache-2.0
|
|||||||
|
|
||||||
# used for oslotest cross-testing scripts
|
# used for oslotest cross-testing scripts
|
||||||
oslo.config>=5.2.0 # Apache-2.0
|
oslo.config>=5.2.0 # Apache-2.0
|
||||||
|
|
||||||
# Bandit security code scanner
|
|
||||||
bandit>=1.7.0,<1.8.0 # Apache-2.0
|
|
||||||
|
|
||||||
pre-commit>=2.6.0 # MIT
|
|
||||||
|
7
tox.ini
7
tox.ini
@ -12,10 +12,10 @@ deps =
|
|||||||
commands = stestr run --slowest {posargs}
|
commands = stestr run --slowest {posargs}
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
|
deps =
|
||||||
|
pre-commit
|
||||||
commands =
|
commands =
|
||||||
pre-commit run -a
|
pre-commit run -a
|
||||||
# Run security linter
|
|
||||||
bandit -r oslo_utils -x tests -n5
|
|
||||||
|
|
||||||
[testenv:venv]
|
[testenv:venv]
|
||||||
commands = {posargs}
|
commands = {posargs}
|
||||||
@ -32,9 +32,6 @@ commands =
|
|||||||
[testenv:cover]
|
[testenv:cover]
|
||||||
commands = python setup.py test --coverage --coverage-package-name=oslo_utils --testr-args='{posargs}'
|
commands = python setup.py test --coverage --coverage-package-name=oslo_utils --testr-args='{posargs}'
|
||||||
|
|
||||||
[testenv:bandit]
|
|
||||||
commands = bandit -r oslo_utils -x tests -n5
|
|
||||||
|
|
||||||
[flake8]
|
[flake8]
|
||||||
# E731 skipped as assign a lambda expression
|
# E731 skipped as assign a lambda expression
|
||||||
# W504 line break after binary operator
|
# W504 line break after binary operator
|
||||||
|
Loading…
x
Reference in New Issue
Block a user