Skip to content

Commit 34c898e

Browse files
committed
Replace pyupgrade with builtin Ruff's UP rule
1 parent 69f3dd2 commit 34c898e

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

.pre-commit-config.yaml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,14 @@ repos:
3030
rev: v0.7.0
3131
hooks:
3232
- id: ruff
33-
args:
34-
- --fix
35-
36-
- repo: https://github.com/asottile/pyupgrade
37-
rev: v3.19.0
38-
hooks:
39-
- id: pyupgrade
40-
args: [--py39-plus, --keep-runtime-typing]
41-
name: Upgrade code with exceptions
33+
args: ["--fix"]
4234
exclude: |
4335
(?x)(
4436
^versioneer.py|
4537
^monai/_version.py|
46-
^monai/networks/| # avoid typing rewrites
47-
^monai/apps/detection/utils/anchor_utils.py| # avoid typing rewrites
48-
^tests/test_compute_panoptic_quality.py # avoid typing rewrites
38+
^monai/networks/| # todo: avoid typing rewrites
39+
^monai/apps/detection/utils/anchor_utils.py| # todo: avoid typing rewrites
40+
^tests/test_compute_panoptic_quality.py # todo: avoid typing rewrites
4941
)
5042
5143
- repo: https://github.com/asottile/yesqa

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ target-version = "py39"
4545
select = [
4646
"E", "F", "W", # flake8
4747
"NPY", # NumPy specific rules
48+
"UP", # pyupgrade
4849
]
4950
extend-ignore = [
5051
"E741", # ambiguous variable name

0 commit comments

Comments
 (0)