Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • C403

    Unnecessary list comprehension (rewrite as a set comprehension)

    Always autofixable
  • C404

    Unnecessary list comprehension (rewrite as a dict comprehension)

    Always autofixable
  • C405

    Unnecessary {kind} literal (rewrite as a set literal)

    Always autofixable
  • C406

    Unnecessary {obj_type} literal (rewrite as a dict literal)

    Always autofixable
  • C408

    Unnecessary {kind}() call (rewrite as a literal)

    Always autofixable
  • C409

    Unnecessary list literal passed to tuple() (rewrite as a tuple literal)

    Some reports are autofixable
  • C410

    Unnecessary list literal passed to list() (remove the outer call to list())

    Always autofixable
  • C411

    Unnecessary list() call (remove the outer call to list())

    Some reports are autofixable
  • C413

    Unnecessary {func}() call around sorted()

    Always autofixable
  • C414

    Unnecessary {inner}() call within {outer}()

    Always autofixable
  • C415

    Unnecessary subscript reversal of iterable within {func}()

    No autofix
  • C416

    Unnecessary {kind} comprehension (rewrite using {kind}())

    Always autofixable
  • C417

    Unnecessary map() usage (rewrite using a {object_type})

    Some reports are autofixable
  • C418

    Unnecessary dict {kind} passed to dict() (remove the outer call to dict())

    Some reports are autofixable
  • C419

    Unnecessary list comprehension

    Some reports are autofixable
  • C420

    Unnecessary dict comprehension for iterable; use dict.fromkeys instead

    Some reports are autofixable
  • COM818

    Trailing comma on bare tuple prohibited

    No autofix
  • COM819

    Trailing comma prohibited

    Always autofixable
  • D201

    No blank lines allowed before function docstring (found {num_lines})

    Some reports are autofixable
  • D202

    No blank lines allowed after function docstring (found {num_lines})

    Some reports are autofixable
  • D204

    1 blank line required after class docstring

    Always autofixable
  • D206

    Docstring should be indented with spaces, not tabs

    No autofix
  • D207

    Docstring is under-indented

    Always autofixable
  • D208

    Docstring is over-indented

    Always autofixable
  • D209

    Multi-line docstring closing quotes should be on a separate line

    Always autofixable
  • D210

    No whitespaces allowed surrounding docstring text

    Some reports are autofixable
  • D211

    No blank lines allowed before class docstring

    Always autofixable
  • D212

    Multi-line docstring summary should start at the first line

    Always autofixable
  • D214

    Section is over-indented ("{name}")

    Always autofixable
  • D215

    Section underline is over-indented ("{name}")

    Always autofixable
  • D300

    Use triple double quotes """

    Some reports are autofixable
  • D301

    Use r""" if any backslashes in a docstring

    Some reports are autofixable