-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
[3.13] Lint: Create a project-wide .ruff.toml
settings file (GH-133124)
#137670
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 3.13
Are you sure you want to change the base?
Conversation
Co-authored-by: Alex Waygood <[email protected]> (cherry picked from commit fe3c7e1)
@encukou this is synching more linting config changes. Ref: #137641 (comment) |
@@ -0,0 +1 @@ | |||
extend = "../../.ruff.toml" # Inherit the project-wide settings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we include the other stuff from main
?
https://github.com/python/cpython/blob/main/Tools/build/.ruff.toml
extend = "../../.ruff.toml" # Inherit the project-wide settings | |
extend = "../../.ruff.toml" # Inherit the project-wide settings | |
[per-file-target-version] | |
"deepfreeze.py" = "py311" # requires `code.co_exceptiontable` | |
"stable_abi.py" = "py311" # requires 'tomllib' | |
[format] | |
preview = true | |
docstring-code-format = true | |
[lint] | |
select = [ | |
"C4", # flake8-comprehensions | |
"E", # pycodestyle | |
"F", # pyflakes | |
"I", # isort | |
"ISC", # flake8-implicit-str-concat | |
"LOG", # flake8-logging | |
"PGH", # pygrep-hooks | |
"PT", # flake8-pytest-style | |
"PYI", # flake8-pyi | |
"RUF100", # Ban unused `# noqa` comments | |
"UP", # pyupgrade | |
"W", # pycodestyle | |
"YTT", # flake8-2020 | |
] | |
ignore = [ | |
"E501", # Line too long | |
"F541", # f-string without any placeholders | |
"PYI024", # Use `typing.NamedTuple` instead of `collections.namedtuple` | |
"PYI025", # Use `from collections.abc import Set as AbstractSet` | |
"UP038", # Use `X | Y` in `isinstance` call instead of `(X, Y)` | |
] | |
[lint.per-file-ignores] | |
"{check_extension_modules,freeze_modules}.py" = [ | |
"UP031", # Use format specifiers instead of percent format | |
] | |
"generate_{re_casefix,sre_constants,token}.py" = [ | |
"UP031", # Use format specifiers instead of percent format | |
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, maybe. I just wanted to keep the backport atomic and as close as possible to the specific PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We haven't backported Tools/build/.ruff.toml
previously, I would suggest @webknjaz you just delete it from this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could do that or actually look into backporting the rest in a follow-up.
(cherry picked from commit fe3c7e1)
📚 Documentation preview 📚: https://cpython-previews--137670.org.readthedocs.build/