Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • PIE807

    Prefer {container} over useless lambda

    Some reports are autofixable
  • PIE808

    Unnecessary start argument in range

    Always autofixable
  • PIE810

    Call {attr} once with a tuple

    Always autofixable
  • PLC0105

    {kind} name "{param_name}" does not reflect its {variance}; consider renaming it to "{replacement_name}"

    No autofix
  • PLC0131

    {kind} cannot be both covariant and contravariant

    No autofix
  • PLC0132

    {kind} name {param_name} does not match assigned variable name {var_name}

    No autofix
  • PLC0205

    Class __slots__ should be a non-string iterable

    No autofix
  • PLC0206

    Extracting value from dictionary without calling .items()

    No autofix
  • PLC0207

    String is split more times than necessary

    Always autofixable
  • PLC0208

    Use a sequence type instead of a set when iterating over values

    Always autofixable
  • PLC0415

    import should be at the top-level of a file

    No autofix
  • PLC1802

    len({expression}) used as condition without comparison

    Always autofixable
  • PLC1901

    {existing} can be simplified to {replacement} as an empty string is falsey

    No autofix
  • PLC2401

    {kind} name {name} contains a non-ASCII character

    No autofix
  • PLC2403

    Module alias {name} contains a non-ASCII character

    No autofix
  • PLC2801

    Unnecessary dunder call to {method}. {replacement}.

    Some reports are autofixable
  • 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