Skip to content
This repository was archived by the owner on Apr 13, 2023. It is now read-only.

Commit a10a6b2

Browse files
authored
Merge pull request #757 from staticdev/feature/remove-flake8-bandit
Remove flake8-bandit in favor of bandit
2 parents 36d5477 + 9c470f9 commit a10a6b2

File tree

12 files changed

+385
-558
lines changed

12 files changed

+385
-558
lines changed

.flake8

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
[flake8]
2-
select = B,B9,C,D,E,F,N,RST,S,W
2+
select = B,B9,C,D,E,F,N,RST,W
33
ignore = E203,E501,W503
44
max-line-length = 80
55
max-complexity = 10
66
docstring-convention = google
7-
per-file-ignores = tests/*:S101, S105
87
rst-roles = class,const,func,meth,mod,ref
98
rst-directives = deprecated
109
; darglint

.pre-commit-config.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
repos:
22
- repo: local
33
hooks:
4+
- id: bandit
5+
name: bandit
6+
entry: bandit
7+
language: system
8+
types: [python]
9+
require_serial: true
10+
args: ["-c", "bandit.yml"]
411
- id: black
512
name: black
613
entry: black
@@ -52,7 +59,7 @@ repos:
5259
language: system
5360
types: [text]
5461
stages: [commit, push, manual]
55-
- repo: https://github.com/prettier/pre-commit
56-
rev: v2.1.2
62+
- repo: https://github.com/pre-commit/mirrors-prettier
63+
rev: v2.7.1
5764
hooks:
5865
- id: prettier

bandit.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
assert_used:
2+
skips: ["*/test_*.py"]

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def activate_virtualenv_in_precommit_hooks(session: Session) -> None:
4242
Args:
4343
session: The Session object.
4444
"""
45-
assert session.bin is not None # noqa: S101
45+
assert session.bin is not None # nosec
4646

4747
# Only patch hooks containing a reference to this session's bindir. Support
4848
# quoting rules for Python and bash, but strip the outermost quotes so we
@@ -106,10 +106,10 @@ def precommit(session: Session) -> None:
106106
"""Lint using pre-commit."""
107107
args = session.posargs or ["run", "--all-files", "--show-diff-on-failure"]
108108
session.install(
109+
"bandit",
109110
"black",
110111
"darglint",
111112
"flake8",
112-
"flake8-bandit",
113113
"flake8-bugbear",
114114
"flake8-docstrings",
115115
"flake8-rst-docstrings",

0 commit comments

Comments
 (0)