Skip to content

Commit a2c5c61

Browse files
committed
Replace flake8 and isort with ruff
1 parent ff8b20f commit a2c5c61

File tree

5 files changed

+59
-74
lines changed

5 files changed

+59
-74
lines changed

.pre-commit-config.yaml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,19 @@
11
repos:
2-
- repo: https://github.com/asottile/seed-isort-config
3-
rev: v2.2.0
4-
hooks:
5-
- id: seed-isort-config
6-
7-
- repo: https://github.com/pre-commit/mirrors-isort
8-
rev: v5.10.1
9-
hooks:
10-
- id: isort
11-
12-
- repo: https://github.com/asottile/pyupgrade
13-
rev: v3.2.2
14-
hooks:
15-
- id: pyupgrade
16-
args: ["--py36-plus"]
17-
182
- repo: https://github.com/psf/black
19-
rev: 22.10.0
3+
rev: 23.3.0
204
hooks:
215
- id: black
226
types: [python]
237

24-
- repo: https://github.com/pycqa/flake8
25-
rev: 5.0.4
8+
- repo: https://github.com/charliermarsh/ruff-pre-commit
9+
rev: v0.0.260
2610
hooks:
27-
- id: flake8
28-
additional_dependencies: ["flake8-bugbear"]
11+
- id: ruff
12+
language: system
13+
args: [--fix, --exit-non-zero-on-fix]
2914

3015
- repo: https://github.com/pre-commit/pre-commit-hooks
31-
rev: v4.3.0
16+
rev: v4.4.0
3217
hooks:
3318
- id: trailing-whitespace
3419
- id: end-of-file-fixer
@@ -39,7 +24,7 @@ repos:
3924
args: ["--fix=lf"]
4025

4126
- repo: https://github.com/mgedmin/check-manifest
42-
rev: "0.48"
27+
rev: "0.49"
4328
hooks:
4429
- id: check-manifest
4530

mypy.ini

Lines changed: 0 additions & 28 deletions
This file was deleted.

pyproject.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[tool.ruff]
2+
src = ["src"]
3+
target-version = "py37"
4+
select = [
5+
'B',
6+
'C',
7+
'E',
8+
'F',
9+
'N',
10+
'W',
11+
'UP',
12+
'RUF',
13+
'INP',
14+
'I'
15+
]
16+
ignore = [
17+
'E501',
18+
'B904',
19+
'B905',
20+
]
21+
22+
[tool.pytest.ini_options]
23+
addopts = "-p no:doctest --cov=extra_checks --cov-branch --ds=tests.settings"
24+
django_find_project = false
25+
26+
[tool.mypy]
27+
plugins = ["mypy_django_plugin.main"]
28+
29+
disallow_untyped_defs = true
30+
check_untyped_defs = true
31+
ignore_missing_imports = true
32+
implicit_reexport = true
33+
strict_equality = true
34+
warn_unreachable = true
35+
show_error_codes = true
36+
37+
no_implicit_optional = true
38+
strict_optional = true
39+
warn_no_return = true
40+
warn_redundant_casts = true
41+
warn_unused_ignores = true
42+
43+
[[tool.mypy.overrides]]
44+
module = ["tests.*"]
45+
disallow_untyped_defs = false
46+
47+
[tool.django-stubs]
48+
django_settings_module = "tests.settings"

pytest.ini

Lines changed: 0 additions & 6 deletions
This file was deleted.

setup.cfg

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ classifiers =
1515
Framework :: Django :: 3.2
1616
Framework :: Django :: 4.0
1717
Framework :: Django :: 4.1
18+
Framework :: Django :: 4.2
1819
Intended Audience :: Developers
1920
License :: OSI Approved :: MIT License
2021
Operating System :: OS Independent
@@ -48,23 +49,8 @@ dev =
4849
djangorestframework
4950
django-stubs
5051
djangorestframework-stubs
51-
mypy<0.990
52-
flake8
53-
flake8-bugbear
52+
mypy
53+
ruff
5454
pre-commit
55-
isort
5655
pdbpp
5756
black
58-
59-
[flake8]
60-
max-line-length = 110
61-
ignore = E126,E127,E501,E731,W503
62-
63-
[isort]
64-
multi_line_output = 3
65-
include_trailing_comma = True
66-
force_grid_wrap = 0
67-
use_parentheses = True
68-
line_length = 88
69-
known_first_party = extra_checks
70-
known_third_party = django,pytest,rest_framework,setuptools

0 commit comments

Comments
 (0)