mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-24 13:33:50 +00:00
![]() Of the rules that flake8-pyi enforces for `.pyi` type stubs, many of them equally make sense to check in normal runtime code with type annotations. Broaden these rules to check all files: PYI013 ellipsis-in-non-empty-class-body PYI016 duplicate-union-member PYI018 unused-private-type-var PYI019 custom-type-var-return-type PYI024 collections-named-tuple PYI025 unaliased-collections-abc-set-import PYI030 unnecessary-literal-union PYI032 any-eq-ne-annotation PYI034 non-self-return-type PYI036 bad-exit-annotation PYI041 redundant-numeric-union PYI042 snake-case-type-alias PYI043 t-suffixed-type-alias PYI045 iter-method-return-iterable PYI046 unused-private-protocol PYI047 unused-private-type-alias PYI049 unused-private-typed-dict PYI050 no-return-argument-annotation-in-stub (Python ≥ 3.11) PYI051 redundant-literal-union PYI056 unsupported-method-call-on-all The other rules are stub-specific and remain enabled only in `.pyi` files. PYI001 unprefixed-type-param PYI002 complex-if-statement-in-stub PYI003 unrecognized-version-info-check PYI004 patch-version-comparison PYI005 wrong-tuple-length-version-comparison (could make sense to broaden, see https://github.com/astral-sh/ruff/pull/6297#issuecomment-1663314807) PYI006 bad-version-info-comparison (same) PYI007 unrecognized-platform-check PYI008 unrecognized-platform-name PYI009 pass-statement-stub-body PYI010 non-empty-stub-body PYI011 typed-argument-default-in-stub PYI012 pass-in-class-body PYI014 argument-default-in-stub PYI015 assignment-default-in-stub PYI017 complex-assignment-in-stub PYI020 quoted-annotation-in-stub PYI021 docstring-in-stub PYI026 type-alias-without-annotation (could make sense to broaden, but gives many false positives on runtime code as currently implemented) PYI029 str-or-repr-defined-in-stub PYI033 type-comment-in-stub PYI035 unassigned-special-variable-in-stub PYI044 future-annotations-in-stub PYI048 stub-body-multiple-statements PYI052 unannotated-assignment-in-stub PYI053 string-or-bytes-too-long PYI054 numeric-literal-too-long Signed-off-by: Anders Kaseorg <andersk@mit.edu> |
||
---|---|---|
.. | ||
flake8_to_ruff | ||
ruff | ||
ruff_benchmark | ||
ruff_cache | ||
ruff_cli | ||
ruff_dev | ||
ruff_diagnostics | ||
ruff_formatter | ||
ruff_index | ||
ruff_macros | ||
ruff_python_ast | ||
ruff_python_codegen | ||
ruff_python_formatter | ||
ruff_python_index | ||
ruff_python_literal | ||
ruff_python_parser | ||
ruff_python_resolver | ||
ruff_python_semantic | ||
ruff_python_stdlib | ||
ruff_python_trivia | ||
ruff_shrinking | ||
ruff_source_file | ||
ruff_text_size | ||
ruff_wasm |