8000 Switched from flake8 and isort to ruff · agronholm/exceptiongroup@c926b0a · GitHub
[go: up one dir, main page]

Skip to content

Commit c926b0a

Browse files
committed
Switched from flake8 and isort to ruff
1 parent 0d63387 commit c926b0a

File tree

3 files changed

+21
-34
lines changed

3 files changed

+21
-34
lines changed

.pre-commit-config.yaml

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,21 @@ repos:
1515
args: ["--fix=lf"]
1616
- id: trailing-whitespace
1717

18-
- repo: https://github.com/pycqa/isort
19-
rev: 5.12.0
20-
hooks:
21-
- id: isort
22-
2318
- repo: https://github.com/asottile/pyupgrade
2419
rev: v3.6.0
2520
hooks:
2621
- id: pyupgrade
2722
args: ["--py37-plus", "--keep-runtime-typing"]
2823

24+
- repo: https://github.com/charliermarsh/ruff-pre-commit
25+
rev: v0.0.272
26+
hooks:
27+
- id: ruff
28+
args: [--fix, --show-fixes]
29+
exclude: "tests/test_catch_py311.py"
30+
2931
- repo: https://github.com/psf/black
3032
rev: 23.3.0
3133
hooks:
3234
- id: black
3335
exclude: "tests/test_catch_py311.py"
34-
35-
- repo: https://github.com/csachs/pyproject-flake8
36-
rev: v6.0.0.post1
37-
hooks:
38-
- id: pyproject-flake8
39-
additional_dependencies: [flake8-bugbear]
40-
exclude: "tests/test_catch_py311.py"
41-
42-
- repo: https://github.com/pre-commit/pygrep-hooks
43-
rev: v1.10.0
44-
hooks:
45-
- id: python-check-blanket-noqa
46-
- id: python-check-blanket-type-ignore
47-
- id: python-no-eval
48-
- id: python-use-type-annotations
49-
- id: rst-backticks
50-
- id: rst-directive-colons
51-
- id: rst-inline-touching-normal

pyproject.toml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,19 @@ version_scheme = "post-release"
4444
local_scheme = "dirty-tag"
4545
write_to = "src/exceptiongroup/_version.py"
4646

47-
[tool.black]
48-
target-version = ['py37']
49-
50-
[tool.isort]
51-
src_paths = ["src"]
52-
skip_gitignore = true
53-
profile = "black"
47+
[tool.ruff]
48+
line-length = 88
49+
select = [
50+
"E", "F", "W", # default flake-8
51+
"I", # isort
52+
"ISC", # flake8-implicit-str-concat
53+
"PGH", # pygrep-hooks
54+
"RUF100", # unused noqa (yesqa)
55+
]
56+
target-version = "py37"
5457

55-
[tool.flake8]
56-
max-line-length = 88
58+
[tool.ruff.isort]
59+
known-first-party = ["exce 8000 ptiongroup"]
5760

5861
[tool.pytest.ini_options]
5962
addopts = "-rsx --tb=short --strict-config --strict-markers"

tests/test_exceptions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def test_basics_subgroup_by_predicate__match(self):
290290
]
291291

292292
for match_type, template in testcases:
293-
subeg = eg.subgroup(lambda e: isinstance(e, match_type)) # noqa: B023
293+
subeg = eg.subgroup(lambda e: isinstance(e, match_type))
294294
self.assertEqual(subeg.message, eg.message)
295295
self.assertMatchesTemplate(subeg, ExceptionGroup, template)
296296

@@ -355,7 +355,7 @@ def test_basics_split_by_predicate__match(self):
355355
]
356356

357357
for match_type, match_template, rest_template in testcases:
358-
match, rest = eg.split(lambda e: isinstance(e, match_type)) # noqa: B023
358+
match, rest = eg.split(lambda e: isinstance(e, match_type))
359359
self.assertEqual(match.message, eg.message)
360360
self.assertMatchesTemplate(match, ExceptionGroup, match_template)
361361
if rest_template is not None:

0 commit comments

Comments
 (0)
0