Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • PLE0604

    Invalid object in __all__, must contain only strings

    No autofix
  • PLE0605

    Invalid format for __all__, must be tuple or list

    No autofix
  • PLE0643

    Expression is likely to raise IndexError

    No autofix
  • PLE0704

    Bare raise statement is not inside an exception handler

    No autofix
  • PLE1132

    Repeated keyword argument: {duplicate_keyword}

    No autofix
  • PLE1141

    Unpacking a dictionary in iteration without calling .items()

    Always autofixable
  • PLE1142

    await should be used within an async function

    No autofix
  • PLE1205

    Too many arguments for logging format string

    No autofix
  • PLE1206

    Not enough arguments for logging format string

    No autofix
  • PLE1300

    Unsupported format character '{format_char}'

    No autofix
  • PLE1307

    Format type does not match argument type

    No autofix
  • PLE1310

    String {strip} call contains duplicate characters (did you mean {removal}?)

    No autofix
  • PLE1507

    Invalid type for initial os.getenv argument; expected str

    No autofix
  • PLE1519

    @singledispatch decorator should not be used on methods

    Some reports are autofixable
  • PLE1520

    @singledispatchmethod decorator should not be used on non-method functions

    Some reports are autofixable
  • PLE1700

    yield from statement in async function; use async for instead

    No autofix
  • PLE2502

    Contains control characters that can permit obfuscated code

    No autofix
  • PLE2510

    Invalid unescaped character backspace, use "\b" instead

    Some reports are autofixable
  • PLE2512

    Invalid unescaped character SUB, use "\x1a" instead

    Some reports are autofixable
  • PLE2513

    Invalid unescaped character ESC, use "\x1b" instead

    Some reports are autofixable
  • PLE2514

    Invalid unescaped character NUL, use "\0" instead

    Some reports are autofixable
  • PLE2515

    Invalid unescaped character zero-width-space, use "\u200B" instead

    Some reports are autofixable
  • PLE4703

    Iterated set {name} is modified within the for loop

    Always autofixable
  • PLR0124

    Name compared with itself, consider replacing {actual}

    No autofix
  • PLR0133

    Two constants compared in a comparison, consider replacing {left_constant} {op} {right_constant}

    No autofix
  • PLR0202

    Class method defined without decorator

    Always autofixable
  • PLR0203

    Static method defined without decorator

    Always autofixable
  • PLR0206

    Cannot have defined parameters for properties

    No autofix
  • PLR0402

    Use from {module} import {name} in lieu of alias

    Some reports are autofixable
  • PLR0904

    Too many public methods ({methods} > {max_methods})

    No autofix
  • PLR0914

    Too many local variables ({current_amount} > {max_amount})

    No autofix
  • PLR0916

    Too many Boolean expressions ({expressions} > {max_expressions})

    No autofix