Ruff
902 rules ruff@0.16.8
Complete effective rule inventory.
Rules
No enabled Ruff rules match this search.
-
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 -
PYI061Use
Nonerather thanLiteral[None] -
PYI062Duplicate literal member
{} -
PYI063Use PEP 570 syntax for positional-only parameters
-
PYI064Final[Literal[{literal}]]can be replaced with a bareFinal -
PYI066Put branches for newer Python versions first when branching on
sys.version_infocomparisons -
pytest-fixture-autouseAvoid using
autouse=Trueinpytest.fixturedecorators -
Q000Single quotes found but double quotes preferred
-
Q001Single quote multiline found but double quotes preferred
-
Q002Single quote docstring found but double quotes preferred
-
Q003Change outer quotes to avoid escaping inner quotes
-
Q004Unnecessary escape on inner quote character
-
RET501Do not explicitly
return Nonein function if it is the only possible return value -
RET502Do not implicitly
return Nonein function able to return non-Nonevalue -
RET503Missing explicit
returnat the end of function able to return non-Nonevalue -
RET504Unnecessary assignment to
{name}beforereturnstatement -
RET505Unnecessary
{branch}afterreturnstatement -
RET506Unnecessary
{branch}afterraisestatement -
RET507Unnecessary
{branch}aftercontinuestatement -
RET508Unnecessary
{branch}afterbreakstatement -
RSE102Unnecessary parentheses on raised exception
-
RUF002Docstring contains ambiguous {}. Did you mean {}?
-
RUF003Comment contains ambiguous {}. Did you mean {}?
-
RUF005Consider
{expression}instead of concatenation -
RUF006Store a reference to the return value of
{expr}.{method} -
RUF007Prefer
itertools.pairwise()overzip()when iterating over successive pairs -
RUF008Do not use mutable default values for dataclass attributes
-
RUF009Do not perform function call
{name}in dataclass defaults -
RUF010Use explicit conversion flag
-
RUF012Mutable default value for class attribute
-
RUF013PEP 484 prohibits implicit
Optional -
RUF015Prefer
next({iterable})over single element slice -
RUF016Slice in indexed access to type
{value_type}uses type{index_type}instead of an integer