Skip to content

Ruff

903 rules ruff@0.17.0

Complete effective rule inventory.

Docs

Rules

32 rules on this page · 903 total

  • N818

    Exception name {name} should be named with an Error suffix

    No autofix
  • N999

    Invalid module name: '{name}'

    No autofix
  • NPY001

    Type alias np.{type_name} is deprecated, replace with builtin type

    Some reports are autofixable
  • NPY002

    Replace legacy np.random.{method_name} call with np.random.Generator

    No autofix
  • NPY003

    np.{existing} is deprecated; use np.{replacement} instead

    Some reports are autofixable
  • NPY201

    np.{existing} will be removed in NumPy 2.0. {migration_guide}

    Some reports are autofixable
  • PD002

    inplace=True should be avoided; it has inconsistent behavior

    Some reports are autofixable
  • PD003

    .isna is preferred to .isnull; functionality is equivalent

    No autofix
  • PD004

    .notna is preferred to .notnull; functionality is equivalent

    No autofix
  • PD007

    .ix is deprecated; use more explicit .loc or .iloc

    No autofix
  • PD008

    Use .loc instead of .at. If speed is important, use NumPy.

    No autofix
  • PD009

    Use .iloc instead of .iat. If speed is important, use NumPy.

    No autofix
  • PD010

    .pivot_table is preferred to .pivot or .unstack; provides same functionality

    No autofix
  • PD011

    Use .to_numpy() or .array instead of .values

    No autofix
  • PD012

    Use .read_csv instead of .read_table to read CSV files

    No autofix
  • PD013

    .melt is preferred to .stack; provides same functionality

    No autofix
  • PD015

    Use .merge method instead of pd.merge function. They have equivalent functionality.

    No autofix
  • PD101

    Using series.nunique() for checking that a series is constant is inefficient

    No autofix
  • PERF101

    Do not cast an iterable to list before iterating over it

    Always autofixable
  • PERF102

    When using only the {subset} of a dict use the {subset}() method

    Always autofixable
  • PERF203

    try-except within a loop incurs performance overhead

    No autofix
  • PERF401

    Use {message_str} to create a transformed list

    Some reports are autofixable
  • PERF402

    Use list or list.copy to create a copy of a list

    No autofix
  • PERF403

    Use a dictionary comprehension instead of {modifier} for-loop

    Some reports are autofixable
  • PGH003

    Use specific rule codes when ignoring type issues

    No autofix
  • PGH004

    Use specific rule codes when using noqa

    Some reports are autofixable
  • PGH005

    Mock method should be called: {name}

    No autofix
  • PIE790

    Unnecessary pass statement

    Always autofixable
  • PIE794

    Class field {name} is defined multiple times

    Always autofixable
  • PIE796

    Enum contains duplicate value: {value}

    No autofix
  • PIE800

    Unnecessary spread **

    Some reports are autofixable
  • PIE804

    Unnecessary dict kwargs

    Some reports are autofixable