Forbid extremely long line lengths in non-autogenerated stubs (#12537)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Avasam
2024-08-18 16:03:34 -04:00
committed by GitHub
parent eca1df49f3
commit 937270df0c
15 changed files with 69 additions and 27 deletions

View File

@@ -3,6 +3,7 @@ line-length = 130
target-version = ["py310"]
skip-magic-trailing-comma = true
# Exclude protobuf files because they have long line lengths
# that can't be autofixed. Like docstrings and import aliases.
# Ideally, we could configure Black to allow longer line lengths
# for just these files, but doesn't seem possible yet.
force-exclude = ".*_pb2.pyi"
@@ -91,13 +92,16 @@ ignore = [
# B033 could be slightly useful but Ruff doesn't have per-file select
"B", # flake8-bugbear
# Rules that are out of the control of stub authors:
"E501", # Line too long
"E741", # ambiguous variable name
"F403", # `from . import *` used; unable to detect undefined names
# Stubs can sometimes re-export entire modules.
# Issues with using a star-imported name will be caught by type-checkers.
"F405", # may be undefined, or defined from star imports
]
# See comment on black's force-exclude config above
"*_pb2.pyi" = [
"E501", # Line too long
]
[tool.ruff.lint.isort]
split-on-trailing-comma = false