Skip to content

Ruff

902 rules ruff@0.16.8

Complete effective rule inventory.

Docs

Rules

40 rules on this page · 902 total

  • ICN001

    {name} should be imported as {asname}

    Some reports are autofixable
  • ICN002

    {name} should not be imported as {asname}

    No autofix
  • ICN003

    Members of {name} should not be imported explicitly

    No autofix
  • INP001

    File {filename} is part of an implicit namespace package. Add an __init__.py.

    No autofix
  • INT001

    f-string in plural argument is resolved before function call

    No autofix
  • INT002

    format method in plural argument is resolved before function call

    No autofix
  • INT003

    printf-style format in plural argument is resolved before function call

    No autofix
  • ISC001

    Implicitly concatenated string literals on one line

    Some reports are autofixable
  • ISC002

    Implicitly concatenated string literals over multiple lines

    No autofix
  • ISC003

    Explicitly concatenated string should be implicitly concatenated

    Some reports are autofixable
  • ISC004

    Unparenthesized implicit string concatenation in collection

    Always autofixable
  • LOG001

    Use logging.getLogger() to instantiate loggers

    Some reports are autofixable
  • LOG002

    Use __name__ with logging.getLogger()

    Some reports are autofixable
  • LOG004

    .exception() call outside exception handlers

    Some reports are autofixable
  • LOG007

    Use of logging.exception with falsy exc_info

    No autofix
  • LOG009

    Use of undocumented logging.WARN constant

    Some reports are autofixable
  • LOG014

    exc_info= outside exception handlers

    Some reports are autofixable
  • LOG015

    {}() call on root logger

    No autofix
  • N801

    Class name {name} should use CapWords convention

    No autofix
  • N802

    Function name {name} should be lowercase

    No autofix
  • N803

    Argument name {name} should be lowercase

    No autofix
  • N804

    First argument of a class method should be named cls

    Some reports are autofixable
  • N805

    First argument of a method should be named self

    Some reports are autofixable
  • N806

    Variable {name} in function should be lowercase

    No autofix
  • N807

    Function name should not start and end with __

    No autofix
  • N811

    Constant {name} imported as non-constant {asname}

    No autofix
  • N812

    Lowercase {name} imported as non-lowercase {asname}

    No autofix
  • N813

    Camelcase {name} imported as lowercase {asname}

    No autofix
  • N814

    Camelcase {name} imported as constant {asname}

    No autofix
  • N815

    Variable {name} in class scope should not be mixedCase

    No autofix
  • N816

    Variable {name} in global scope should not be mixedCase

    No autofix
  • N817

    CamelCase {name} imported as acronym {asname}

    No autofix
  • 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