Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • 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
  • FURB118

    Use operator.{operator} instead of defining a {target}

    Some reports are autofixable
  • FURB122

    Use of {}.write in a for loop

    Always autofixable
  • FURB129

    Instead of calling readlines(), iterate over file object directly

    Always autofixable
  • FURB131

    Prefer clear over deleting a full slice

    Some reports are autofixable
  • FURB132

    Use {suggestion} instead of check and remove

    Always autofixable
  • FURB136

    Replace if expression with {min_max} call

    Some reports are autofixable
  • FURB140

    Use itertools.starmap instead of the generator

    Some reports are autofixable
  • FURB142

    Use of set.{}() in a for loop

    Always autofixable