From 056c6235eefab5582c3a6803aa9a3cdea2c0c894 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Ollivier?= Date: Sat, 25 May 2019 11:03:40 +0200 Subject: [PATCH] Run bandit when verifying changes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It reports only MEDIUM issues or higher like nova [1]. It selects bandit 1.1.0 as defined in nova and neutron lower constraints [2]. [1] https://github.com/openstack/nova/blob/master/tox.ini#L221 [2] https://github.com/openstack/nova/blob/master/lower-constraints.txt#L8 Change-Id: I52524df867d99fae75798475c762a5f8253dacfa Signed-off-by: Cédric Ollivier (cherry picked from commit c659caccbf1f55db4e6e3cb31bf088ac57751e86) --- test-requirements.txt | 1 + tox.ini | 4 ++++ upper-constraints.txt | 1 + 3 files changed, 6 insertions(+) diff --git a/test-requirements.txt b/test-requirements.txt index 0cfead31..bac66abe 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -12,3 +12,4 @@ yamllint doc8 # Apache-2.0 bashate # Apache-2.0 ansible-lint +bandit diff --git a/tox.ini b/tox.ini index 5910c199..1dedf986 100644 --- a/tox.ini +++ b/tox.ini @@ -57,6 +57,10 @@ files = build.sh commands = bashate {[testenv:bashate]files} +[testenv:bandit] +basepython = python2.7 +commands = bandit -r xtesting -x tests -n 5 -ll -s B602 + [testenv:cover] basepython = python2.7 dirs = diff --git a/upper-constraints.txt b/upper-constraints.txt index a884d02b..3bfdf036 100644 --- a/upper-constraints.txt +++ b/upper-constraints.txt @@ -1 +1,2 @@ robotframework===3.0.2 +bandit===1.1.0 -- 2.16.6