Skip to content

Ruff

902 rules ruff@0.16.8

Complete effective rule inventory.

Docs

Rules

40 rules on this page · 902 total

  • PLC3002

    Lambda expression called directly. Execute the expression inline instead.

    No autofix
  • PLE0100

    __init__ method is a generator

    No autofix
  • PLE0101

    Explicit return in __init__

    No autofix
  • PLE0115

    Name {name} is both nonlocal and global

    No autofix
  • PLE0116

    continue not supported inside finally clause

    No autofix
  • PLE0117

    Nonlocal name {name} found without binding

    No autofix
  • PLE0118

    Name {name} is used prior to global declaration on {row}

    No autofix
  • PLE0237

    Attribute {name} is not defined in class's __slots__

    No autofix
  • PLE0241

    Duplicate base {base} for class {class}

    Some reports are autofixable
  • PLE0302

    The special method {} expects {}, {} {} given

    No autofix
  • PLE0303

    __len__ does not return a non-negative integer

    No autofix
  • PLE0304

    __bool__ does not return bool

    No autofix
  • PLE0305

    __index__ does not return an integer

    No autofix
  • PLE0307

    __str__ does not return str

    No autofix
  • PLE0308

    __bytes__ does not return bytes

    No autofix
  • PLE0309

    __hash__ does not return an integer

    No autofix
  • 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