Skip to content

Commit

Permalink
Fix the bandit config
Browse files Browse the repository at this point in the history
Signed-off-by: Aurélien Bompard <[email protected]>
  • Loading branch information
abompard committed Jul 7, 2021
1 parent e311bb4 commit 4e1577a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .bandit.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[bandit]
targets: datanommer.commands,datanommer.consumer,datanommer.models
exclude: */tests
# Can't do this now because of https://github.com/PyCQA/bandit/issues/693
#exclude: .git,.tox,*/tests/*,*/.tox/*
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ repos:
hooks:
- id: python-bandit-vulnerability-check
alias: bandit
args: ["--ini", ".bandit.cfg", "-ll"]
args: ["--ini", ".bandit.cfg", "-r", "-ll", "-x", ".git,.tox,*/tests/*,*/.tox/*"]
# - repo: local
# hooks:
# - id: bandit-local
Expand Down
9 changes: 8 additions & 1 deletion datanommer.commands/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37,38,39},lint
envlist = py{36,37,38,39},lint,security
skipsdist = True

[base]
Expand All @@ -26,3 +26,10 @@ commands =
black --check {[base]package}/{posargs}
isort --check {[base]package}/{posargs}
flake8 {[base]package}/{posargs}


[testenv:security]
deps =
bandit
commands =
bandit -r -ll -x ./.tox,./tests .
9 changes: 8 additions & 1 deletion datanommer.consumer/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37,38,39},lint
envlist = py{36,37,38,39},lint,security
skipsdist = True

[base]
Expand All @@ -25,3 +25,10 @@ commands =
black --check {[base]package}/{posargs}
isort --check {[base]package}/{posargs}
flake8 {[base]package}/{posargs}


[testenv:security]
deps =
bandit
commands =
bandit -r -ll -x ./.tox,./tests .
9 changes: 8 additions & 1 deletion datanommer.models/tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py{36,37,38,39},lint
envlist = py{36,37,38,39},lint,security
skipsdist = True

[base]
Expand All @@ -23,3 +23,10 @@ commands =
black --check {[base]package}/{posargs}
isort --check {[base]package}/{posargs}
flake8 {[base]package}/{posargs}


[testenv:security]
deps =
bandit
commands =
bandit -r -ll -x ./.tox,./tests .

0 comments on commit 4e1577a

Please sign in to comment.