Skip to content

Commit fe3c7e1

Browse files
Lint: Create a project-wide .ruff.toml settings file (#133124)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
1 parent 5cdd49b commit fe3c7e1

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

.ruff.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Default settings for Ruff in CPython
2+
3+
# PYTHON_FOR_REGEN
4+
target-version = "py310"
5+
6+
# PEP 8
7+
line-length = 79
8+
9+
# Enable automatic fixes by default.
10+
# To override this, use ``fix = false`` in a subdirectory's config file
11+
# or ``--no-fix`` on the command line.
12+
fix = true

Doc/.ruff.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
extend = "../.ruff.toml" # Inherit the project-wide settings
2+
13
target-version = "py312" # Align with the version in oldest_supported_sphinx
2-
fix = true
3-
output-format = "full"
4-
line-length = 79
54
extend-exclude = [
65
"includes/*",
76
# Temporary exclusions:

Lib/test/.ruff.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
fix = true
1+
extend = "../../.ruff.toml" # Inherit the project-wide settings
2+
23
extend-exclude = [
34
# Excluded (run with the other AC files in its own separate ruff job in pre-commit)
45
"test_clinic.py",

Tools/build/.ruff.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
target-version = "py310"
2-
fix = true
3-
line-length = 79
1+
extend = "../../.ruff.toml" # Inherit the project-wide settings
42

53
[lint]
64
select = [

Tools/clinic/.ruff.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
target-version = "py310"
2-
fix = true
1+
extend = "../../.ruff.toml" # Inherit the project-wide settings
32

43
[lint]
54
select = [

0 commit comments

Comments
 (0)