From 2cdda12df78275b98a5d3cdc8a92f93d596d9d5d Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 28 Dec 2024 14:30:24 -0500 Subject: [PATCH] Move RUF022+RUF023 ignores to stubs only and remove TODO (#13322) Move RUF022+RUF023 to stubs only and remove TODO --- lib/ts_utils/metadata.py | 2 +- pyproject.toml | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/ts_utils/metadata.py b/lib/ts_utils/metadata.py index 2ae052d64..2942794e9 100644 --- a/lib/ts_utils/metadata.py +++ b/lib/ts_utils/metadata.py @@ -23,8 +23,8 @@ from .utils import cache __all__ = [ "NoSuchStubError", - "StubMetadata", "PackageDependencies", + "StubMetadata", "StubtestSettings", "get_recursive_requirements", "read_dependencies", diff --git a/pyproject.toml b/pyproject.toml index db4e5501b..424fb108d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -77,10 +77,6 @@ extend-safe-fixes = [ "UP036", # Remove unnecessary `sys.version_info` blocks ] ignore = [ - # TODO: Ruff 0.8.0 added sorting of __all__ and __slots_. Validate whether we want this in stubs - "RUF022", - "RUF023", - ### # Rules that can conflict with the formatter (Black) # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules @@ -106,6 +102,11 @@ 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", # Most flake8-bugbear rules don't apply for third-party stubs like typeshed. # B033 could be slightly useful but Ruff doesn't have per-file select "B", # flake8-bugbear