Skip to content

Ruff

902 rules ruff@0.16.8

Complete effective rule inventory.

Docs

Rules

40 rules on this page · 902 total

  • F541

    f-string without any placeholders

    Always autofixable
  • F601

    Dictionary key literal {name} repeated

    Some reports are autofixable
  • F602

    Dictionary key {name} repeated

    Some reports are autofixable
  • F621

    Too many expressions in star-unpacking assignment

    No autofix
  • F622

    Two starred expressions in assignment

    No autofix
  • F631

    Assert test is a non-empty tuple, which is always True

    No autofix
  • F632

    Use == to compare constant literals

    Always autofixable
  • F633

    Use of >> is invalid with print function

    No autofix
  • F634

    If test is a tuple, which is always True

    No autofix
  • F701

    break outside loop

    No autofix
  • F702

    continue not properly in loop

    No autofix
  • F704

    {keyword} statement outside of a function

    No autofix
  • F706

    return statement outside of a function/method

    No autofix
  • F707

    An except block as not the last exception handler

    No autofix
  • F722

    Syntax error in forward annotation: {parse_error}

    No autofix
  • F811

    Redefinition of unused {name} from {row}

    Some reports are autofixable
  • F821

    Undefined name {name}. {tip}

    No autofix
  • F822

    Undefined name {name} in __all__

    No autofix
  • F823

    Local variable {name} referenced before assignment

    No autofix
  • F841

    Local variable {name} is assigned to but never used

    Some reports are autofixable
  • F842

    Local variable {name} is annotated but never used

    No autofix
  • F901

    raise NotImplemented should be raise NotImplementedError

    Some reports are autofixable
  • FA100

    Add from __future__ import annotations to simplify {name}

    Always autofixable
  • FA102

    Missing from __future__ import annotations, but uses {reason}

    Always autofixable
  • FAST001

    FastAPI route with redundant response_model argument

    Always autofixable
  • FAST002

    FastAPI dependency without Annotated

    Some reports are autofixable
  • FAST003

    Parameter {arg_name} appears in route path, but not in {function_name} signature

    Some reports are autofixable
  • FBT001

    Boolean-typed positional argument in function definition

    No autofix
  • FBT002

    Boolean default positional argument in function definition

    No autofix
  • FBT003

    Boolean positional value in function call

    No autofix
  • FIX001

    Line contains FIXME, consider resolving the issue

    No autofix
  • FIX003

    Line contains XXX, consider resolving the issue

    No autofix
  • FIX004

    Line contains HACK, consider resolving the issue

    No autofix
  • FLY002

    Consider {expression} instead of string join

    Always autofixable
  • FURB101

    Path.open() followed by read() can be replaced by {filename}.{suggestion}

    Some reports are autofixable
  • FURB103

    Path.open() followed by write() can be replaced by {filename}.{suggestion}

    Some reports are autofixable
  • FURB105

    Unnecessary empty string passed to print

    Always autofixable
  • FURB110

    Replace ternary if expression with or operator

    Always autofixable
  • FURB113

    Use {suggestion} instead of repeatedly calling {name}.append()

    Some reports are autofixable
  • FURB116

    Replace {function_name} call with {display}

    Some reports are autofixable