Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • TRY201

    Use raise without specifying exception name

    Always autofixable
  • TRY203

    Remove exception handler; error is immediately re-raised

    No autofix
  • TRY300

    Consider moving this statement to an else block

    No autofix
  • TRY301

    Abstract raise to an inner function

    No autofix
  • TRY400

    Use logging.exception instead of logging.error

    Some reports are autofixable
  • TRY401

    Redundant exception object included in logging.exception call

    No autofix
  • UP001

    __metaclass__ = type is implied

    Always autofixable
  • UP003

    Use {} instead of type(...)

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