Skip to content

Commit

Permalink
Eliminated pyupgrade and black in favor of ruff/ruff-format
Browse files Browse the repository at this point in the history
  • Loading branch information
agronholm committed Nov 21, 2023
1 parent d025269 commit 767e62b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
13 changes: 1 addition & 12 deletions .pre-commit-config.yaml
Expand Up @@ -15,21 +15,10 @@ repos:
args: ["--fix=lf"]
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args: ["--py37-plus", "--keep-runtime-typing"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.6
hooks:
- id: ruff
args: [--fix, --show-fixes]
exclude: "tests/test_catch_py311.py"

- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
exclude: "tests/test_catch_py311.py"
- id: ruff-format
6 changes: 4 additions & 2 deletions pyproject.toml
Expand Up @@ -45,15 +45,17 @@ local_scheme = "dirty-tag"
write_to = "src/exceptiongroup/_version.py"

[tool.ruff]
line-length = 88
select = [
"E", "F", "W", # default flake-8
"I", # isort
"ISC", # flake8-implicit-str-concat
"PGH", # pygrep-hooks
"RUF100", # unused noqa (yesqa)
]
target-version = "py37"

[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true

[tool.ruff.isort]
known-first-party = ["exceptiongroup"]
Expand Down
2 changes: 1 addition & 1 deletion src/exceptiongroup/_exceptions.py
Expand Up @@ -27,7 +27,7 @@ def check_direct_subclass(
def get_condition_filter(
condition: type[_BaseExceptionT]
| tuple[type[_BaseExceptionT], ...]
| Callable[[_BaseExceptionT_co], bool]
| Callable[[_BaseExceptionT_co], bool],
) -> Callable[[_BaseExceptionT_co], bool]:
if isclass(condition) and issubclass(
cast(Type[BaseException], condition), BaseException
Expand Down

0 comments on commit 767e62b

Please sign in to comment.