Skip to content

Commit 767e62b

Browse files
committed
Eliminated pyupgrade and black in favor of ruff/ruff-format
1 parent d025269 commit 767e62b

File tree

3 files changed

+6
-15
lines changed

3 files changed

+6
-15
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,10 @@ repos:
1515
args: ["--fix=lf"]
1616
- id: trailing-whitespace
1717

18-
- repo: https://github.com/asottile/pyupgrade
19-
rev: v3.15.0
20-
hooks:
21-
- id: pyupgrade
22-
args: ["--py37-plus", "--keep-runtime-typing"]
23-
2418
- repo: https://github.com/astral-sh/ruff-pre-commit
2519
rev: v0.1.6
2620
hooks:
2721
- id: ruff
2822
args: [--fix, --show-fixes]
2923
exclude: "tests/test_catch_py311.py"
30-
31-
- repo: https://github.com/psf/black
32-
rev: 23.11.0
33-
hooks:
34-
- id: black
35-
exclude: "tests/test_catch_py311.py"
24+
- id: ruff-format

pyproject.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,17 @@ local_scheme = "dirty-tag"
4545
write_to = "src/exceptiongroup/_version.py"
4646

4747
[tool.ruff]
48-
line-length = 88
4948
select = [
5049
"E", "F", "W", # default flake-8
5150
"I", # isort
5251
"ISC", # flake8-implicit-str-concat
5352
"PGH", # pygrep-hooks
5453
"RUF100", # unused noqa (yesqa)
5554
]
56-
target-version = "py37"
55+
56+
[tool.ruff.pyupgrade]
57+
# Preserve types, even if a file imports `from __future__ import annotations`.
58+
keep-runtime-typing = true
5759

5860
[tool.ruff.isort]
5961
known-first-party = ["exceptiongroup"]

src/exceptiongroup/_exceptions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def check_direct_subclass(
2727
def get_condition_filter(
2828
condition: type[_BaseExceptionT]
2929
| tuple[type[_BaseExceptionT], ...]
30-
| Callable[[_BaseExceptionT_co], bool]
30+
| Callable[[_BaseExceptionT_co], bool],
3131
) -> Callable[[_BaseExceptionT_co], bool]:
3232
if isclass(condition) and issubclass(
3333
cast(Type[BaseException], condition), BaseException

0 commit comments

Comments
 (0)