Browse Source

add bandit to pep8 job

Add the bandit security scanner to the pep8 job.

Change-Id: Ie418ecadcff9351a776ff790492c73225efddb6f
tags/2.20.0
ChangBo Guo(gcb) 1 year ago
parent
commit
c7a2b56c4f
2 changed files with 9 additions and 1 deletions
  1. 3
    0
      test-requirements.txt
  2. 6
    1
      tox.ini

+ 3
- 0
test-requirements.txt View File

@@ -11,3 +11,6 @@ coverage!=4.4,>=4.0 # Apache-2.0
11 11
 openstackdocstheme>=1.17.0 # Apache-2.0
12 12
 sphinx>=1.6.2 # BSD
13 13
 reno>=2.5.0 # Apache-2.0
14
+
15
+# Bandit security code scanner
16
+bandit>=1.1.0 # Apache-2.0

+ 6
- 1
tox.ini View File

@@ -12,7 +12,12 @@ deps = -r{toxinidir}/test-requirements.txt
12 12
 commands = python setup.py testr --slowest --testr-args='{posargs}'
13 13
 
14 14
 [testenv:pep8]
15
-commands = flake8
15
+deps =
16
+  -r{toxinidir}/test-requirements.txt
17
+commands =
18
+  flake8
19
+  # Run security linter
20
+  bandit -r oslo_context -x tests -n5
16 21
 
17 22
 [testenv:venv]
18 23
 commands = {posargs}

Loading…
Cancel
Save