Skip to content

Ruff

902 rules ruff@0.16.8

Complete effective rule inventory.

Docs

Rules

40 rules on this page · 902 total

  • UP004

    Class {name} inherits from object

    Always autofixable
  • UP005

    {alias} is deprecated, use {target}

    Always autofixable
  • UP006

    Use {to} instead of {from} for type annotation

    Some reports are autofixable
  • UP007

    Use X | Y for type annotations

    Some reports are autofixable
  • UP008

    Use super() instead of super(__class__, self)

    Some reports are autofixable
  • UP009

    UTF-8 encoding declaration is unnecessary

    Always autofixable
  • UP010

    Unnecessary __future__ import {import} for target Python version

    Always autofixable
  • UP011

    Unnecessary parentheses to functools.lru_cache

    Always autofixable
  • UP012

    Unnecessary call to encode as UTF-8

    Always autofixable
  • UP013

    Convert {name} from TypedDict functional to class syntax

    Some reports are autofixable
  • UP014

    Convert {name} from NamedTuple functional to class syntax

    Some reports are autofixable
  • UP015

    Unnecessary mode argument

    Always autofixable
  • UP017

    Use datetime.UTC alias

    Some reports are autofixable
  • UP018

    Unnecessary {literal_type} call (rewrite as a literal)

    Always autofixable
  • UP019

    {}.Text is deprecated, use str

    Some reports are autofixable
  • UP020

    Use builtin open

    Some reports are autofixable
  • UP021

    universal_newlines is deprecated, use text

    Always autofixable
  • UP022

    Prefer capture_output over sending stdout and stderr to PIPE

    Some reports are autofixable
  • UP023

    cElementTree is deprecated, use ElementTree

    Some reports are autofixable
  • UP024

    Replace aliased errors with OSError

    Always autofixable
  • UP025

    Remove unicode literals from strings

    Always autofixable
  • UP026

    mock is deprecated, use unittest.mock

    Some reports are autofixable
  • UP028

    Replace yield over for loop with yield from

    Some reports are autofixable
  • UP029

    Unnecessary builtin import: {import}

    Always autofixable
  • UP030

    Use implicit references for positional format fields

    Some reports are autofixable
  • UP031

    Use format specifiers instead of percent format

    Some reports are autofixable
  • UP032

    Use f-string instead of format call

    Some reports are autofixable
  • UP033

    Use @functools.cache instead of @functools.lru_cache(maxsize=None)

    Always autofixable
  • UP034

    Avoid extraneous parentheses

    Always autofixable
  • UP035

    Import from {target} instead: {names}

    Some reports are autofixable
  • UP036

    Version block is outdated for minimum Python version

    Some reports are autofixable
  • UP037

    Remove quotes from type annotation

    Always autofixable
  • UP039

    Unnecessary parentheses after class definition

    Always autofixable
  • UP040

    Type alias {name} uses {type_alias_method} instead of the type keyword

    Always autofixable
  • UP041

    Replace aliased errors with TimeoutError

    Always autofixable
  • UP042

    Class {name} inherits from both str and enum.Enum

    Some reports are autofixable
  • UP043

    Unnecessary default type arguments

    Always autofixable
  • UP044

    Use * for unpacking

    Always autofixable
  • UP045

    Use X | None for type annotations

    Some reports are autofixable
  • UP046

    Generic class {name} uses Generic subclass instead of type parameters

    Some reports are autofixable