Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • UP030

    Use implicit references for positional format fields

    Some reports are autofixable
  • UP031

    Use format specifiers instead of percent format

    Some reports are autofixable
  • UP032

    Use f-string instead of format call

    Some reports are autofixable
  • UP033

    Use @functools.cache instead of @functools.lru_cache(maxsize=None)

    Always autofixable
  • UP034

    Avoid extraneous parentheses

    Always autofixable
  • UP035

    Import from {target} instead: {names}

    Some reports are autofixable
  • UP036

    Version block is outdated for minimum Python version

    Some reports are autofixable
  • UP037

    Remove quotes from type annotation

    Always autofixable
  • UP039

    Unnecessary parentheses after class definition

    Always autofixable
  • UP040

    Type alias {name} uses {type_alias_method} instead of the type keyword

    Always autofixable
  • UP041

    Replace aliased errors with TimeoutError

    Always autofixable
  • UP042

    Class {name} inherits from both str and enum.Enum

    Some reports are autofixable
  • UP043

    Unnecessary default type arguments

    Always autofixable
  • UP044

    Use * for unpacking

    Always autofixable
  • UP045

    Use X | None for type annotations

    Some reports are autofixable
  • UP046

    Generic class {name} uses Generic subclass instead of type parameters

    Some reports are autofixable
  • UP047

    Generic function {name} should use type parameters

    Always autofixable
  • UP048

    Use while True: instead of while 1:

    Always autofixable
  • UP049

    Generic {} uses private type parameters

    Some reports are autofixable
  • UP050

    Class {name} uses metaclass=type, which is redundant

    Some reports are autofixable
  • UP051

    Use @{to} and @abstractmethod instead of {from}

    Always autofixable
  • UP052

    Use {generator} instead of {iterator} for a context manager

    Some reports are autofixable
  • W191

    Indentation contains tabs

    No autofix
  • W291

    Trailing whitespace

    Always autofixable
  • W292

    No newline at end of file

    Always autofixable
  • W293

    Blank line contains whitespace

    Always autofixable
  • W391

    Too many newlines at end of {domain}

    Always autofixable
  • W505

    Doc line too long ({width} > {limit})

    No autofix
  • W605

    Invalid escape sequence: \{ch}

    Always autofixable
  • YTT101

    sys.version[:3] referenced (python3.10), use sys.version_info

    No autofix
  • YTT102

    sys.version[2] referenced (python3.10), use sys.version_info

    No autofix
  • YTT103

    sys.version compared to string (python3.10), use sys.version_info

    No autofix