Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • RUF053

    Class with type parameter list inherits from Generic

    Some reports are autofixable
  • RUF054

    Indented form feed

    No autofix
  • RUF055

    Plain string pattern passed to re function

    Some reports are autofixable
  • RUF056

    Avoid providing a falsy fallback to dict.get() in boolean test positions. The default fallback None is already falsy.

    Some reports are autofixable
  • RUF057

    Value being rounded is already an integer

    Always autofixable
  • RUF058

    itertools.starmap called on zip iterable

    Some reports are autofixable
  • RUF059

    Unpacked variable {name} is never used

    Some reports are autofixable
  • RUF060

    Unnecessary membership test on empty collection

    No autofix
  • RUF061

    Use context-manager form of pytest.{}()

    Some reports are autofixable
  • RUF063

    Use {suggestion} instead of __dict__ access

    No autofix
  • RUF064

    Non-octal mode

    Some reports are autofixable
  • RUF065

    Unnecessary oct() conversion when formatting with %s. Use %#o instead of %s

    No autofix
  • RUF066

    {name} is a property without a return statement

    No autofix
  • RUF067

    __init__ module should not contain any code

    No autofix
  • RUF069

    Unreliable floating point equality comparison {left} {operator} {right}

    No autofix
  • RUF070

    Unnecessary assignment to {name} before yield from statement

    Always autofixable
  • RUF071

    os.path.commonprefix() compares strings character-by-character

    Some reports are autofixable
  • RUF072

    Empty finally clause

    Some reports are autofixable
  • RUF073

    % operator used on an f-string

    No autofix
  • RUF074

    @{outer_decorator} should be placed after @{inner_decorator}

    No autofix
  • RUF075

    Context manager does not catch exceptions

    No autofix
  • RUF077

    Receiver parameter should not have a default value

    Always autofixable
  • RUF100

    Unused {}

    Always autofixable
  • RUF101

    {original} is a redirect to {target}

    Always autofixable
  • RUF102

    Invalid rule code in {}: {}

    Always autofixable
  • RUF103

    Invalid suppression comment: {msg}

    Always autofixable
  • RUF104

    Suppression comment without matching #ruff:enable comment

    No autofix
  • RUF105

    noqa comment used instead of ruff: ignore

    Some reports are autofixable
  • RUF106

    Rule code used instead of name in suppression comment

    Always autofixable
  • RUF200

    Failed to parse pyproject.toml: {message}

    No autofix
  • RUF201

    Rule code used instead of name in lint.{selector}

    Always autofixable
  • S101

    Use of assert detected

    No autofix