Skip to content

Commit fc1f891

Browse files
committed
Replace Flake8 with Ruff
1 parent 47a77eb commit fc1f891

File tree

3 files changed

+36
-31
lines changed

3 files changed

+36
-31
lines changed

.flake8

-2
This file was deleted.

.pre-commit-config.yaml

+8-26
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,15 @@
11
repos:
2-
- repo: https://github.com/asottile/pyupgrade
3-
rev: v3.15.0
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.2.1
44
hooks:
5-
- id: pyupgrade
6-
args: [--py38-plus]
5+
- id: ruff
6+
args: [--exit-non-zero-on-fix]
77

88
- repo: https://github.com/psf/black-pre-commit-mirror
9-
rev: 23.12.1
9+
rev: 24.1.1
1010
hooks:
1111
- id: black
1212

13-
- repo: https://github.com/PyCQA/isort
14-
rev: 5.13.2
15-
hooks:
16-
- id: isort
17-
18-
- repo: https://github.com/PyCQA/flake8
19-
rev: 6.1.0
20-
hooks:
21-
- id: flake8
22-
additional_dependencies:
23-
[flake8-2020, flake8-errmsg, flake8-implicit-str-concat]
24-
25-
- repo: https://github.com/pre-commit/pygrep-hooks
26-
rev: v1.10.0
27-
hooks:
28-
- id: python-check-blanket-noqa
29-
- id: python-no-log-warn
30-
3113
- repo: https://github.com/pre-commit/pre-commit-hooks
3214
rev: v4.5.0
3315
hooks:
@@ -40,12 +22,12 @@ repos:
4022
- id: trailing-whitespace
4123

4224
- repo: https://github.com/tox-dev/pyproject-fmt
43-
rev: 1.5.3
25+
rev: 1.7.0
4426
hooks:
4527
- id: pyproject-fmt
4628

4729
- repo: https://github.com/abravalheri/validate-pyproject
48-
rev: v0.15
30+
rev: v0.16
4931
hooks:
5032
- id: validate-pyproject
5133

@@ -55,7 +37,7 @@ repos:
5537
- id: tox-ini-fmt
5638

5739
- repo: https://github.com/pre-commit/mirrors-prettier
58-
rev: v3.1.0
40+
rev: v4.0.0-alpha.8
5941
hooks:
6042
- id: prettier
6143
args: [--prose-wrap=always, --print-width=88]

pyproject.toml

+28-3
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,31 @@ version.source = "vcs"
6060
[tool.hatch.version.raw-options]
6161
local_scheme = "no-local-version"
6262

63-
[tool.isort]
64-
add_imports = "from __future__ import annotations"
65-
profile = "black"
63+
[tool.ruff]
64+
fix = true
65+
66+
[tool.ruff.lint]
67+
select = [
68+
"C4", # flake8-comprehensions
69+
"E", # pycodestyle errors
70+
"EM", # flake8-errmsg
71+
"F", # pyflakes errors
72+
"I", # isort
73+
"ISC", # flake8-implicit-str-concat
74+
"LOG", # flake8-logging
75+
"PGH", # pygrep-hooks
76+
"RUF100", # unused noqa (yesqa)
77+
"UP", # pyupgrade
78+
"W", # pycodestyle warnings
79+
"YTT", # flake8-2020
80+
]
81+
extend-ignore = [
82+
"E203", # Whitespace before ':'
83+
"E221", # Multiple spaces before operator
84+
"E226", # Missing whitespace around arithmetic operator
85+
"E241", # Multiple spaces after ','
86+
]
87+
88+
[tool.ruff.lint.isort]
89+
known-first-party = ["stravavis"]
90+
required-imports = ["from __future__ import annotations"]

0 commit comments

Comments
 (0)