mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Enable Ruff ANN2 (flake8-annotations, autofixes only) (#13331)
This commit is contained in:
@@ -50,6 +50,8 @@ select = [
|
||||
"E", # pycodestyle Error
|
||||
"F", # Pyflakes
|
||||
"W", # pycodestyle Warning
|
||||
# Only include flake8-annotations rules that are autofixable. Otherwise leave this to mypy+pyright
|
||||
"ANN2",
|
||||
# Most refurb rules are in preview and can be opinionated,
|
||||
# consider them individually as they come out of preview (last check: 0.8.4)
|
||||
"FURB105", # Unnecessary empty string passed to `print`
|
||||
@@ -114,11 +116,9 @@ ignore = [
|
||||
|
||||
[tool.ruff.lint.per-file-ignores]
|
||||
"*.pyi" = [
|
||||
# Ruff 0.8.0 added sorting of __all__ and __slots_.
|
||||
# There is no consensus on whether we want to apply this to stubs, so keeping the status quo.
|
||||
# See https://github.com/python/typeshed/pull/13108
|
||||
"RUF022",
|
||||
"RUF023",
|
||||
# A lot of stubs are incomplete on purpose, and that's configured through pyright
|
||||
# Some ANN204 (special method) are autofixable in stubs, but not all.
|
||||
"ANN2", # Missing return type annotation for ...
|
||||
# Most pep8-naming rules don't apply for third-party stubs like typeshed.
|
||||
# N811 to N814 could apply, but we often use them to disambiguate a name whilst making it look like a more common one
|
||||
"N8",
|
||||
@@ -127,6 +127,11 @@ ignore = [
|
||||
# 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
|
||||
# Ruff 0.8.0 added sorting of __all__ and __slots_.
|
||||
# There is no consensus on whether we want to apply this to stubs, so keeping the status quo.
|
||||
# See https://github.com/python/typeshed/pull/13108
|
||||
"RUF022",
|
||||
"RUF023",
|
||||
]
|
||||
# See comment on black's force-exclude config above
|
||||
"*_pb2.pyi" = [
|
||||
|
||||
Reference in New Issue
Block a user