Skip to content

Commit 1369f68

Browse files
committed
Remove bandit from pre-commit and enable ruff bandit rules
1 parent 18fe2c3 commit 1369f68

File tree

3 files changed

+18
-49
lines changed

3 files changed

+18
-49
lines changed

.pre-commit-config.yaml

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,14 @@
11
repos:
2-
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
# Ruff version.
4-
rev: v0.14.2
5-
hooks:
6-
- id: ruff
7-
- id: ruff-format
8-
args: [--config, ./pyproject.toml]
9-
- repo: https://github.com/asottile/pyupgrade
10-
rev: v3.21.0
11-
hooks:
12-
- id: pyupgrade
13-
args: [--py38-plus]
14-
- repo: https://github.com/PyCQA/bandit
15-
rev: 1.8.6
16-
hooks:
17-
- id: bandit
18-
args:
19-
- --configfile=pyproject.toml
20-
- --quiet
21-
- --format=custom
22-
files: ^(xbox|tests)/.+\.py$
23-
- repo: https://github.com/pre-commit/pre-commit-hooks
24-
rev: v6.0.0
25-
hooks:
26-
- id: check-executables-have-shebangs
27-
stages: [manual]
28-
- id: check-json
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
# Ruff version.
4+
rev: v0.14.2
5+
hooks:
6+
- id: ruff
7+
- id: ruff-format
8+
args: [--config, ./pyproject.toml]
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v6.0.0
11+
hooks:
12+
- id: check-executables-have-shebangs
13+
stages: [manual]
14+
- id: check-json

pyproject.toml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,14 @@ line-length = 88
4747
target-version = "py311"
4848

4949
[tool.ruff.lint]
50-
select = ["E4", "E7", "E9", "F", "UP"]
50+
select = ["E4", "E7", "E9", "F", "UP", "S"]
5151
ignore = []
5252

5353

5454
[tool.ruff.lint.per-file-ignores]
55-
"**/scripts/*" = ["UP"]
55+
"**/scripts/*" = ["UP", "S104"]
56+
"tests/*" = ["S101"]
57+
"src/pythonxbox/authentication/xal.py" = ["S101"]
5658

5759
[tool.ruff.lint.isort]
5860
force-sort-within-sections = true
@@ -64,25 +66,6 @@ split-on-trailing-comma = false
6466
quote-style = "double"
6567
indent-style = "space"
6668

67-
68-
[tool.bandit]
69-
exclude_dirs = ["tests"]
70-
tests = [
71-
"B108",
72-
"B306",
73-
"B307",
74-
"B313",
75-
"B314",
76-
"B315",
77-
"B316",
78-
"B317",
79-
"B318",
80-
"B319",
81-
"B320",
82-
"B602",
83-
"B604"
84-
]
85-
8669
[tool.hatch.version]
8770
source = "regex_commit"
8871
commit_extra_args = ["-e"]

src/pythonxbox/api/provider/titlehub/models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class TitleFields(str, Enum):
99
SERVICE_CONFIG_ID = "scid"
1010
ACHIEVEMENT = "achievement"
1111
STATS = "stats"
12-
GAME_PASS = "gamepass"
12+
GAME_PASS = "gamepass" # noqa: S105
1313
IMAGE = "image"
1414
DETAIL = "detail"
1515
FRIENDS_WHO_PLAYED = "friendswhoplayed"

0 commit comments

Comments
 (0)