Skip to content

Commit f90d169

Browse files
committed
Move target-version from .pre-commit-config to Lib/test/.ruff.toml
1 parent 61e2c30 commit f90d169

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repos:
88
files: ^Doc/
99
- id: ruff
1010
name: Run Ruff (lint) on Lib/test/
11-
args: [--exit-non-zero-on-fix, --target-version=py313]
11+
args: [--exit-non-zero-on-fix]
1212
files: ^Lib/test/
1313
- id: ruff
1414
name: Run Ruff (lint) on Tools/build/

Lib/test/.ruff.toml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
extend = "../../.ruff.toml" # Inherit the project-wide settings
22

3+
target-version = "py313"
4+
35
extend-exclude = [
46
# Excluded (run with the other AC files in its own separate ruff job in pre-commit)
57
"test_clinic.py",
@@ -8,15 +10,17 @@ extend-exclude = [
810
# Non UTF-8 files
911
"encoded_modules/module_iso_8859_1.py",
1012
"encoded_modules/module_koi8_r.py",
11-
# SyntaxError because of t-strings
12-
"test_annotationlib.py",
13-
"test_string/test_templatelib.py",
14-
"test_tstring.py",
1513
# New grammar constructions may not yet be recognized by Ruff,
1614
# and tests re-use the same names as only the grammar is being checked.
1715
"test_grammar.py",
1816
]
1917

18+
[per-file-target-version]
19+
# t-strings
20+
"test_annotationlib.py" = "py314"
21+
"test_string/test_templatelib.py" = "py314"
22+
"test_tstring.py" = "py314"
23+
2024
[lint]
2125
select = [
2226
"F401", # Unused import

0 commit comments

Comments
 (0)