Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • PYI061

    Use None rather than Literal[None]

    Some reports are autofixable
  • PYI062

    Duplicate literal member {}

    Always autofixable
  • PYI063

    Use PEP 570 syntax for positional-only parameters

    No autofix
  • PYI064

    Final[Literal[{literal}]] can be replaced with a bare Final

    Some reports are autofixable
  • PYI066

    Put branches for newer Python versions first when branching on sys.version_info comparisons

    No autofix
  • pytest-fixture-autouse

    Avoid using autouse=True in pytest.fixture decorators

    No autofix
  • Q000

    Single quotes found but double quotes preferred

    Some reports are autofixable
  • Q001

    Single quote multiline found but double quotes preferred

    Always autofixable
  • Q002

    Single quote docstring found but double quotes preferred

    Some reports are autofixable
  • Q003

    Change outer quotes to avoid escaping inner quotes

    Always autofixable
  • Q004

    Unnecessary escape on inner quote character

    Always autofixable
  • RET501

    Do not explicitly return None in function if it is the only possible return value

    Always autofixable
  • RET502

    Do not implicitly return None in function able to return non-None value

    Always autofixable
  • RET503

    Missing explicit return at the end of function able to return non-None value

    Always autofixable
  • RET504

    Unnecessary assignment to {name} before return statement

    Always autofixable
  • RET505

    Unnecessary {branch} after return statement

    Some reports are autofixable
  • RET506

    Unnecessary {branch} after raise statement

    Some reports are autofixable
  • RET507

    Unnecessary {branch} after continue statement

    Some reports are autofixable
  • RET508

    Unnecessary {branch} after break statement

    Some reports are autofixable
  • RSE102

    Unnecessary parentheses on raised exception

    Always autofixable
  • RUF002

    Docstring contains ambiguous {}. Did you mean {}?

    No autofix
  • RUF003

    Comment contains ambiguous {}. Did you mean {}?

    No autofix
  • RUF005

    Consider {expression} instead of concatenation

    Some reports are autofixable
  • RUF006

    Store a reference to the return value of {expr}.{method}

    No autofix
  • RUF007

    Prefer itertools.pairwise() over zip() when iterating over successive pairs

    Some reports are autofixable
  • RUF008

    Do not use mutable default values for dataclass attributes

    No autofix
  • RUF009

    Do not perform function call {name} in dataclass defaults

    No autofix
  • RUF010

    Use explicit conversion flag

    Some reports are autofixable
  • RUF012

    Mutable default value for class attribute

    No autofix
  • RUF013

    PEP 484 prohibits implicit Optional

    Some reports are autofixable
  • RUF015

    Prefer next({iterable}) over single element slice

    Always autofixable
  • RUF016

    Slice in indexed access to type {value_type} uses type {index_type} instead of an integer

    No autofix