https://github.com/python/cpython/commit/fe3c7e10d95235e3d7bea9273d61a968cdc83d86
commit: fe3c7e10d95235e3d7bea9273d61a968cdc83d86
branch: main
author: Adam Turner <9087854+aa-tur...@users.noreply.github.com>
committer: AA-Turner <9087854+aa-tur...@users.noreply.github.com>
date: 2025-05-01T08:28:44Z
summary:

Lint: Create a project-wide ``.ruff.toml`` settings file (#133124)

Co-authored-by: Alex Waygood <alex.wayg...@gmail.com>

files:
A .ruff.toml
M Doc/.ruff.toml
M Lib/test/.ruff.toml
M Tools/build/.ruff.toml
M Tools/clinic/.ruff.toml

diff --git a/.ruff.toml b/.ruff.toml
new file mode 100644
index 00000000000000..1c015fa88415bc
--- /dev/null
+++ b/.ruff.toml
@@ -0,0 +1,12 @@
+# Default settings for Ruff in CPython
+
+# PYTHON_FOR_REGEN
+target-version = "py310"
+
+# PEP 8
+line-length = 79
+
+# Enable automatic fixes by default.
+# To override this, use ``fix = false`` in a subdirectory's config file
+# or ``--no-fix`` on the command line.
+fix = true
diff --git a/Doc/.ruff.toml b/Doc/.ruff.toml
index 111ce03b91df38..3e676e13c3f41a 100644
--- a/Doc/.ruff.toml
+++ b/Doc/.ruff.toml
@@ -1,7 +1,6 @@
+extend = "../.ruff.toml"  # Inherit the project-wide settings
+
 target-version = "py312"  # Align with the version in oldest_supported_sphinx
-fix = true
-output-format = "full"
-line-length = 79
 extend-exclude = [
     "includes/*",
     # Temporary exclusions:
diff --git a/Lib/test/.ruff.toml b/Lib/test/.ruff.toml
index 54126bf32619ab..a1eac32a83aae3 100644
--- a/Lib/test/.ruff.toml
+++ b/Lib/test/.ruff.toml
@@ -1,4 +1,5 @@
-fix = true
+extend = "../../.ruff.toml"  # Inherit the project-wide settings
+
 extend-exclude = [
     # Excluded (run with the other AC files in its own separate ruff job in 
pre-commit)
     "test_clinic.py",
diff --git a/Tools/build/.ruff.toml b/Tools/build/.ruff.toml
index e4f024333adf1a..c084c06144adaf 100644
--- a/Tools/build/.ruff.toml
+++ b/Tools/build/.ruff.toml
@@ -1,6 +1,4 @@
-target-version = "py310"
-fix = true
-line-length = 79
+extend = "../../.ruff.toml"  # Inherit the project-wide settings
 
 [lint]
 select = [
diff --git a/Tools/clinic/.ruff.toml b/Tools/clinic/.ruff.toml
index c019572d0cb186..5033887df0c1cd 100644
--- a/Tools/clinic/.ruff.toml
+++ b/Tools/clinic/.ruff.toml
@@ -1,5 +1,4 @@
-target-version = "py310"
-fix = true
+extend = "../../.ruff.toml"  # Inherit the project-wide settings
 
 [lint]
 select = [

_______________________________________________
Python-checkins mailing list -- python-checkins@python.org
To unsubscribe send an email to python-checkins-le...@python.org
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: arch...@mail-archive.com

Reply via email to