Skip to content

Commit f7f8c23

Browse files
authored
[CI] Add Python bandit security linter as a pre-commit hook (#1370)
1 parent 6074850 commit f7f8c23

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,11 @@ repos:
106106
- id: gitleaks
107107
name: run gitleaks
108108
description: check for secrets with gitleaks
109+
- repo: https://github.com/PyCQA/bandit
110+
rev: 92ae8b82fb422a639f0ed8d99e96cea769594e08 # frozen: 1.9.4
111+
hooks:
112+
- id: bandit
113+
name: run bandit
114+
description: check Python code for security issues
115+
args: ['-c=pyproject.toml']
116+
additional_dependencies: ['bandit[toml]']

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[tool.bandit]
2+
skips = ["B101"] # https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html#b101-assert-used

0 commit comments

Comments
 (0)