Skip to content

Commit 2e97bc1

Browse files
committedMay 21, 2024
swap flake8 for ruff
The conflicting errors and warnings from flake8 are already handled by ruff.
1 parent 8894a34 commit 2e97bc1

File tree

3 files changed

+25
-20
lines changed

3 files changed

+25
-20
lines changed
 

‎.flake8

-12
This file was deleted.

‎.pre-commit-config.yaml

+3-8
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,10 @@ repos:
1313
hooks:
1414
- id: black
1515

16-
- repo: https://github.com/PyCQA/flake8
17-
rev: 7.0.0
16+
- repo: https://github.com/astral-sh/ruff-pre-commit
17+
rev: v0.4.4
1818
hooks:
19-
- id: flake8
20-
21-
- repo: https://github.com/timothycrosley/isort
22-
rev: 5.13.2
23-
hooks:
24-
- id: isort
19+
- id: ruff
2520

2621
- repo: https://github.com/asottile/pyupgrade
2722
rev: v3.15.2

‎pyproject.toml

+22
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,25 @@ DJANGO_SETTINGS_MODULE = "core.settings"
3838
python_files = [
3939
"test_*.py",
4040
]
41+
42+
[tool.ruff]
43+
extend-exclude = [
44+
".env",
45+
]
46+
target-version = "py310"
47+
48+
[tool.ruff.lint]
49+
extend-select = [
50+
"A", # flake8-builtins
51+
"I", # isort
52+
"INP", # flake8-no-pep420
53+
"ISC", # flake8-implicit-str-concat
54+
"UP", # pyupgrade
55+
"W", # pycodestyle warning
56+
]
57+
extend-ignore = [
58+
"E731", # allow lambda assignment
59+
]
60+
61+
[tool.ruff.lint.isort]
62+
lines-after-imports = 2

0 commit comments

Comments
 (0)
Please sign in to comment.