Skip to content

Commit cea4a84

Browse files
committed
Upgrade ruff
1 parent 2e995e6 commit cea4a84

4 files changed

Lines changed: 78 additions & 32 deletions

File tree

.github/matrix.py

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# noqa:INP001
12
import fileinput
23
import json
34
import re
@@ -9,21 +10,22 @@
910
def main():
1011
actions_matrix = []
1112

12-
for tox_env in fileinput.input():
13-
tox_env = tox_env.rstrip()
14-
15-
if python_match := PY_VERSIONS_RE.match(tox_env):
16-
version_tuple = python_match.groups()
17-
else:
18-
version_tuple = sys.version_info[0:2]
19-
20-
python_version = "{}.{}".format(*version_tuple)
21-
actions_matrix.append(
22-
{
23-
"python": python_version,
24-
"tox_env": tox_env,
25-
}
26-
)
13+
with fileinput.input() as f:
14+
for tox_env_line in f:
15+
tox_env = tox_env_line.rstrip()
16+
17+
if python_match := PY_VERSIONS_RE.match(tox_env):
18+
version_tuple = python_match.groups()
19+
else:
20+
version_tuple = sys.version_info[0:2]
21+
22+
python_version = "{}.{}".format(*version_tuple)
23+
actions_matrix.append(
24+
{
25+
"python": python_version,
26+
"tox_env": tox_env,
27+
}
28+
)
2729

2830
print(json.dumps(actions_matrix)) # noqa:T201
2931

findreplace/management/commands/findreplace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,6 @@ def get_fields(self):
6565
for model in app.get_models():
6666
for field in model._meta.get_fields():
6767
if isinstance(field, models.CharField | models.TextField):
68-
fields.append(field)
68+
fields.append(field) # noqa:PERF401
6969

7070
return fields

pyproject.toml

Lines changed: 59 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -40,23 +40,67 @@ line-length = 99
4040
target-version = 'py310'
4141

4242
[tool.ruff.lint]
43-
select = [
44-
'F', # pyflakes
45-
'E', # pycodestyle
46-
'W', # pycodestyle
47-
'I', # isort
48-
'N', # pep8-naming
49-
'UP', # pyupgrade
50-
'S', # flake8-bandit
51-
'BLE', # flake8-blind-except
52-
'C4', # flake8-comprehensions
53-
'EM', # flake8-errmsg
54-
'T20', # flake8-print
55-
'RET', # flake8-return
56-
'RUF', # ruff
43+
extend-select = [
44+
'ERA', # eradicate
45+
'YTT', # flake8-2020
46+
'ASYNC', # flake8-async
47+
'S', # flake8-bandit
48+
'BLE', # flake8-blind-except
49+
'B', # flake8-bugbear
50+
'A', # flake8-builtins
51+
'COM', # flake8-commas
52+
'C4', # flake8-comprehensions
53+
'DTZ', # flake8-datetimez
54+
'T10', # flake8-debugger
55+
'DJ', # flake8-django
56+
'EM', # flake8-errmsg
57+
'EXE', # flake8-executable
58+
'FA', # flake8-future-annotations
59+
'INT', # flake8-gettext
60+
'ISC', # flake8-implicit-str-concat
61+
'ICN', # flake8-import-conventions
62+
'LOG', # flake8-logging
63+
'G', # flake8-logging-format
64+
'INP', # flake8-no-pep420
65+
'PIE', # flake8-pie
66+
'T20', # flake8-print
67+
'PYI', # flake8-pyi
68+
'Q', # flake8-quotes
69+
'RSE', # flake8-raise
70+
'RET', # flake8-return
71+
'SLOT', # flake8-slots
72+
'SIM', # flake8-simplify
73+
'TID', # flake8-tidy-imports
74+
'TD', # flake8-todos
75+
'TCH', # flake8-type-checking
76+
'PTH', # flake8-use-pathlib
77+
'FLY', # flynt
78+
'I', # isort
79+
'NPY', # numpy-specific rules
80+
'PD', # pandas-vet
81+
'N', # pep8-naming
82+
'PERF', # perflint
83+
'E', # pycodestyle
84+
'W', # pycodestyle
85+
'F', # pyflakes
86+
'PGH', # pygrep-hooks
87+
'PLC', # pylint
88+
'PLE', # pylint
89+
'PLW', # pylint
90+
'UP', # pyupgrade
91+
'FURB', # refurb
92+
'RUF', # ruff-specific rules
93+
'TRY', # tryceratops
5794
]
5895
ignore = [
59-
'EM101', # flake8-errmsg: raw-string-in-exception
96+
'COM812', # flake8-commas: missing-trailing-comma
97+
'EM101', # flake8-errmsg: raw-string-in-exception
98+
'ISC001', # flake8-implicit-str-concat: single-line-implicit-string-concatenation
99+
'RUF012', # ruff-specific rules: mutable-class-default
100+
'SIM105', # flake8-simplify: suppressible-exception
101+
'SIM108', # flake8-simplify: if-else-block-instead-of-if-exp
102+
'TD002', # flake8-todos: missing-todo-author
103+
'TRY003', # tryceratops: raise-vanilla-args
60104
]
61105

62106
[tool.ruff.lint.isort]

requirements/testing.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ build==1.4.2
22
check-wheel-contents==0.6.3
33
coverage==7.13.5
44
pipdeptree==2.34.0
5-
ruff==0.8.4
5+
ruff==0.15.8
66
twine==6.2.0

0 commit comments

Comments
 (0)