Ruff
903 rules ruff@0.17.0
Complete effective rule inventory.
Rules
No enabled Ruff rules match this search.
-
PYI019Use
Selfinstead of custom TypeVar{} -
PYI020Quoted annotations should not be included in stubs
-
PYI021Docstrings should not be included in stubs
-
PYI024Use
typing.NamedTupleinstead ofcollections.namedtuple -
PYI025Use
from collections.abc import Set as AbstractSetto avoid confusion with thesetbuiltin -
PYI026Use
{module}.TypeAliasfor type alias, e.g.,{name}: TypeAlias = {value} -
PYI029Defining
{name}in a stub is almost always redundant -
PYI030Multiple literal members in a union. Use a single literal, e.g.
Literal[{}] -
PYI032Prefer
objecttoAnyfor the second parameter to{method_name} -
PYI033Don't use type comments
-
PYI034__new__methods usually returnselfat runtime -
PYI035{name}in a stub file must have a value, as it has the same semantics as{name}at runtime -
PYI036Star-args in
{method_name}should be annotated withobject -
PYI041Use
{supertype}instead of{subtype} | {supertype} -
PYI042Type alias
{name}should be CamelCase -
PYI043Private type alias
{name}should not be suffixed withT(theTsuffix implies that an object is aTypeVar) -
PYI044from __future__ import annotationshas no effect in stub files, since type checkers automatically treat stubs as having those semantics -
PYI045__aiter__methods should return anAsyncIterator, not anAsyncIterable -
PYI046Private protocol
{name}is never used -
PYI047Private TypeAlias
{name}is never used -
PYI048Function body must contain exactly one statement
-
PYI049Private TypedDict
{name}is never used -
PYI050Prefer
{module}.NeveroverNoReturnfor argument annotations -
PYI051Literal[{literal}]is redundant in a union with{builtin_type} -
PYI052Need type annotation for
{name} -
PYI053String and bytes literals longer than 50 characters are not permitted
-
PYI054Numeric literals with a string representation longer than ten characters are not permitted
-
PYI055Multiple
typemembers in a union. Combine them into one, e.g.,type[{union_str}]. -
PYI056Calling
.{name}()on__all__may not be supported by all type checkers (use+=instead) -
PYI057Do not use
{origin}.ByteString, which has unclear semantics and is deprecated -
PYI058Use
{return_type}as the return value for simple{method}methods -
PYI059Generic[]should always be the last base class