PEP 257 recommends that multi-line docstrings consist of "a summary line just like a one-line docstring, followed by a blank line, followed by a more elaborate description." Ruff takes this rule from pydocstyle and made it stable in v0.0.69.
- Code
D213- Message
Multi-line docstring summary should start at the second line
This rule enforces a consistent style for docstrings with multiple sections. Ruff takes this rule from pydocstyle and made it stable in v0.0.73.
- Code
D214- Message
Section is over-indented ("{}")
This rule enforces a consistent style for multiline numpy-style docstrings, and helps prevent incorrect syntax in docstrings using reStructuredText. Ruff takes this rule from pydocstyle and made it stable in v0.0.73.
- Code
D215- Message
Section underline is over-indented ("{}")
PEP 257 recommends the use of """triple double quotes""" for docstrings, to ensure consistency. Ruff takes this rule from pydocstyle and made it stable in v0.0.69.
- Code
D300- Message
Use triple double quotes `"""`- Message
Use triple single quotes `'''`
In Python, backslashes are typically used to escape characters in strings. In raw strings (those prefixed with an r), however, backslashes are treated as literal characters. Ruff takes this rule from pydocstyle and made it stable in v0.0.172.
- Code
D301- Message
Use `r"""` if any backslashes in a docstring
PEP 257 recommends that the first line of a docstring is written in the form of a command, ending in a period. Ruff takes this rule from pydocstyle and made it stable in v0.0.68.
- Code
D400- Message
First line should end with a period
PEP 257 recommends that the first line of a docstring be written in the imperative mood, for consistency. Ruff takes this rule from pydocstyle and made it stable in v0.0.228.
- Code
D401- Message
First line of docstring should be in imperative mood: "{}"
PEP 257 recommends against including a function's signature in its docstring. Instead, consider using type annotations as a form of documentation for the function's parameters and return value. Ruff takes this rule from pydocstyle and made it stable in v0.0.70.
- Code
D402- Message
First line should not be the function's signature
The first non-whitespace character in a docstring should be capitalized for grammatical correctness and consistency. Ruff takes this rule from pydocstyle and made it stable in v0.0.69.
- Code
D403- Message
First word of the docstring should be capitalized: `{}` -> `{}`
PEP 257 recommends that the first line of a docstring be written in the imperative mood, for consistency. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D404- Message
First word of the docstring should not be "This"
For stylistic consistency, all section headers in a docstring should be capitalized. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D405- Message
Section name should be properly capitalized ("{}")
This rule enforces a consistent style for multiline numpy-style docstrings. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D406- Message
Section name should end with a newline ("{}")
This rule enforces a consistent style for multiline numpy-style docstrings, and helps prevent incorrect syntax in docstrings using reStructuredText. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D407- Message
Missing dashed underline after section ("{}")
This rule enforces a consistent style for multiline numpy-style docstrings, and helps prevent incorrect syntax in docstrings using reStructuredText. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D408- Message
Section underline should be in the line following the section's name ("{}")
This rule enforces a consistent style for multiline numpy-style docstrings, and helps prevent incorrect syntax in docstrings using reStructuredText. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D409- Message
Section underline should match the length of its name ("{}")
This rule enforces consistency in your docstrings, and helps ensure compatibility with documentation tooling. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D410- Message
Missing blank line after section ("{}")
This rule enforces consistency in numpy-style and Google-style docstrings, and helps ensure compatibility with documentation tooling. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D411- Message
Missing blank line before section ("{}")
This rule enforces a consistent style for multiline docstrings. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D412- Message
No blank lines allowed between a section header and its content ("{}")
This rule enforces a consistent style for multiline docstrings. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D413- Message
Missing blank line after last section ("{}")
An empty section in a multiline docstring likely indicates an unfinished or incomplete docstring. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D414- Message
Section has no content ("{}")
The first line of a docstring should end with a period, question mark, or exclamation point, for grammatical correctness and consistency. Ruff takes this rule from pydocstyle and made it stable in v0.0.69.
- Code
D415- Message
First line should end with a period, question mark, or exclamation point
This rule enforces a consistent style for multiline Google-style docstrings. If a multiline Google-style docstring consists of multiple sections, each section header should end with a colon. Ruff takes this rule from pydocstyle and made it stable in v0.0.74.
- Code
D416- Message
Section name should end with a colon ("{}")
This rule helps prevent you from leaving Google-style docstrings unfinished or incomplete. Multiline Google-style docstrings should describe all parameters for the function they are documenting. Ruff takes this rule from pydocstyle and made it stable in v0.0.73.
- Code
D417- Message
Missing argument description in the docstring for `{}`: `{}`- Message
Missing argument descriptions in the docstring for `{}`: {}
The @overload decorator is used to define multiple compatible signatures for a given function, to support type-checking. A series of @overload definitions should be followed by a single non-decorated definition that contains the implementation of the function. Ruff takes this rule from pydocstyle and made it stable in v0.0.71.
- Code
D418- Message
Function decorated with `@overload` shouldn't contain a docstring
An empty docstring is indicative of incomplete documentation. It should either be removed or replaced with a meaningful docstring. Ruff takes this rule from pydocstyle and made it stable in v0.0.68.
- Code
D419- Message
Docstring is empty
Docstring sections should follow the canonical ordering specified by the docstring convention (NumPy or Google). Consistent ordering makes docstrings easier to read and navigate. Ruff takes this rule from pydocstyle. It is in preview.
- Code
D420- Message
Section "{}" appears after section "{}" but should be before it
The Google Python style guide recommends that the docstring for a @property data descriptor use the same style as the docstring for an attribute or a function argument (e.g., """The Bigtable path."""), rather than a function-style docstring (e.g., """Returns the Bigtable path."""). Ruff takes this rule from pydocstyle. It is in preview.
- Code
D421- Message
Property docstring should not start with a verb ("{}")
If you use --enable-error-code deprecated, mypy generates an error if your code imports a deprecated feature explicitly with a from mod import depr statement or uses a deprecated feature imported otherwise or defined locally. Features are considered deprecated when decorated with warnings.deprecated, as specified in PEP 702. mypy does not enable this error code by default. Use --enable-error-code deprecated to enable it.
- Code
deprecated- Severity
- error
When constructing a dictionary using {key: value, ...} or dict(key=value, ...), mypy checks that each key and value is compatible with the dictionary type that is inferred from the surrounding context. mypy enables this error code by default.
- Code
dict-item- Severity
- error
If a string-based field is nullable, then your model will have two possible representations for "no data": None and the empty string. This can lead to confusion, as clients of the API have to check for both None and the empty string when trying to determine if the field has data. Ruff takes this rule from flake8-django and made it stable in v0.0.246.
- Code
DJ001- Message
Avoid using `null=True` on string-based fields such as `{}`
Using locals() can expose internal variables or other unintentional data to the rendered template. Ruff takes this rule from flake8-django and made it stable in v0.0.253.
- Code
DJ003- Message
Avoid passing `locals()` as context to a `render` function
If a ModelForm includes the exclude attribute, any new field that is added to the model will automatically be exposed for modification. Ruff takes this rule from flake8-django and made it stable in v0.0.253.
- Code
DJ006- Message
Do not use `exclude` with `ModelForm`, use `fields` instead
If a ModelForm includes the fields = "__all__" attribute, any new field that is added to the model will automatically be exposed for modification. Ruff takes this rule from flake8-django and made it stable in v0.0.253.
- Code
DJ007- Message
Do not use `__all__` with `ModelForm`, use `fields` instead
Django models should define a __str__ method to return a string representation of the model instance, as Django calls this method to display the object in the Django Admin and elsewhere. Ruff takes this rule from flake8-django and made it stable in v0.0.246.
- Code
DJ008- Message
Model does not define `__str__` method
The Django Style Guide specifies that the order of Model inner classes, attributes and methods should be as follows: Ruff takes this rule from flake8-django and made it stable in v0.0.258.
- Code
DJ012- Message
Order of model's inner classes, methods, and fields does not follow the Django Style Guide: {} should come before {}
Django's @receiver decorator is special in that it does not return a wrapped function. Rather, @receiver connects the decorated function to a signal. If any other decorators are listed before @receiver, the decorated function will not be connected to the signal. Ruff takes this rule from flake8-django and made it stable in v0.0.246.
- Code
DJ013- Message
`@receiver` decorator must be on top of all the other decorators
If a docstring documents a parameter which is not in the function signature, it can be misleading to users and/or a sign of incomplete documentation or refactors. Ruff takes this rule from pydoclint. It is in preview.
- Code
DOC102- Message
Documented parameter `{}` is not in the function's signature
A missing "Returns" section is a sign of incomplete documentation. Ruff takes this rule from pydoclint. It is in preview.
- Code
DOC201- Message
`return` is not documented in docstring
A function without an explicit return statement should not have a "Returns" section in its docstring. Ruff takes this rule from pydoclint. It is in preview.
- Code
DOC202- Message
Docstring should not have a returns section because the function doesn't return anything
A missing "Yields" section is a sign of incomplete documentation. Ruff takes this rule from pydoclint. It is in preview.
- Code
DOC402- Message
`yield` is not documented in docstring
A function that doesn't yield anything should not have a "Yields" section in its docstring. Ruff takes this rule from pydoclint. It is in preview.
- Code
DOC403- Message
Docstring has a "Yields" section but the function doesn't yield anything
A function should document all exceptions that are directly raised in some circumstances. Failing to document an exception that could be raised can be misleading to users and/or a sign of incomplete documentation. Ruff takes this rule from pydoclint. It is in preview.
- Code
DOC501- Message
Raised exception `{}` missing from docstring
Some conventions prefer non-explicit exceptions be omitted from the docstring. Ruff takes this rule from pydoclint. It is in preview.
- Code
DOC502- Message
Raised exception is not explicitly raised: `{}`- Message
Raised exceptions are not explicitly raised: {}
datetime objects are "naive" by default, in that they do not include timezone information. "Naive" objects are easy to understand, but ignore some aspects of reality, which can lead to subtle bugs. Timezone-aware datetime objects are preferred, as they represent a specific moment in time, unlike "naive" objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ001- Message
`datetime.datetime()` called without a `tzinfo` argument- Message
`tzinfo=None` passed to `datetime.datetime()`
datetime objects are "naive" by default, in that they do not include timezone information. "Naive" objects are easy to understand, but ignore some aspects of reality, which can lead to subtle bugs. Timezone-aware datetime objects are preferred, as they represent a specific moment in time, unlike "naive" objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ002- Message
`datetime.datetime.today()` used
Python datetime objects can be naive or timezone-aware. While an aware object represents a specific moment in time, a naive object does not contain enough information to unambiguously locate itself relative to other datetime objects. Since this can lead to errors, it is recommended to always use timezone-aware objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ003- Message
`datetime.datetime.utcnow()` used
Python datetime objects can be naive or timezone-aware. While an aware object represents a specific moment in time, a naive object does not contain enough information to unambiguously locate itself relative to other datetime objects. Since this can lead to errors, it is recommended to always use timezone-aware objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ004- Message
`datetime.datetime.utcfromtimestamp()` used
Python datetime objects can be naive or timezone-aware. While an aware object represents a specific moment in time, a naive object does not contain enough information to unambiguously locate itself relative to other datetime objects. Since this can lead to errors, it is recommended to always use timezone-aware objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ005- Message
`datetime.datetime.now()` called without a `tz` argument- Message
`tz=None` passed to `datetime.datetime.now()`
Python datetime objects can be naive or timezone-aware. While an aware object represents a specific moment in time, a naive object does not contain enough information to unambiguously locate itself relative to other datetime objects. Since this can lead to errors, it is recommended to always use timezone-aware objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ006- Message
`datetime.datetime.fromtimestamp()` called without a `tz` argument- Message
`tz=None` passed to `datetime.datetime.fromtimestamp()`
Python datetime objects can be naive or timezone-aware. While an aware object represents a specific moment in time, a naive object does not contain enough information to unambiguously locate itself relative to other datetime objects. Since this can lead to errors, it is recommended to always use timezone-aware objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ007- Message
Naive datetime constructed using `datetime.datetime.strptime()` without %z- Message
`datetime.datetime.strptime(...).replace(tz=None)` used
Python date objects are naive, that is, not timezone-aware. While an aware object represents a specific moment in time, a naive object does not contain enough information to unambiguously locate itself relative to other datetime objects. Since this can lead to errors, it is recommended to always use timezone-aware objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ011- Message
`datetime.date.today()` used
Python date objects are naive, that is, not timezone-aware. While an aware object represents a specific moment in time, a naive object does not contain enough information to unambiguously locate itself relative to other datetime objects. Since this can lead to errors, it is recommended to always use timezone-aware objects. Ruff takes this rule from flake8-datetimez and made it stable in v0.0.188.
- Code
DTZ012- Message
`datetime.date.fromtimestamp()` used
datetime.min and datetime.max are non-timezone-aware datetime objects. Ruff takes this rule from flake8-datetimez and made it stable in 0.10.0.
- Code
DTZ901- Message
Use of `datetime.datetime.{}` without timezone information
Used when the special class method __init__ is turned into a generator by a yield in its body. pylint calls it init-is-generator.
- Code
E0100- Severity
- error
- Message
__init__ method is a generator
Used when the special class method __init__ has an explicit return value. pylint calls it return-in-init.
- Code
E0101- Severity
- error
- Message
Explicit return in __init__
Never mix tabs and spaces. Ruff takes this rule from pycodestyle and made it stable in v0.0.229.
- Code
E101- Message
Indentation contains mixed spaces and tabs
Used when a function / class / method is redefined. pylint calls it function-redefined.
- Code
E0102- Severity
- error
- Message
{} already defined line {}
Used when break or continue keywords are used outside a loop. pylint calls it not-in-loop.
- Code
E0103- Severity
- error
- Message
{} not properly in loop
Used when a "return" statement is found outside a function or method. pylint calls it return-outside-function.
- Code
E0104- Severity
- error
- Message
Return outside function
Used when a "yield" statement is found outside a function or method. pylint calls it yield-outside-function.
- Code
E0105- Severity
- error
- Message
Yield outside function
Used when a "return" statement with an argument is found in a generator function or method (e.g. with some "yield" statements). This message can't be emitted when using Python >= 3.3. pylint calls it return-arg-in-generator.
- Code
E0106- Severity
- error
- Message
Return with argument inside generator
Used when you attempt to use the C-style pre-increment or pre-decrement operator -- and ++, which doesn't exist in Python. pylint calls it nonexistent-operator.
- Code
E0107- Severity
- error
- Message
Use of the non-existent {} operator
Duplicate argument names in function definitions are syntax errors. pylint calls it duplicate-argument-name.
- Code
E0108- Severity
- error
- Message
Duplicate argument name {} in function definition
Used when an abstract class with abc.ABCMeta as metaclass has abstract methods and is instantiated. pylint calls it abstract-class-instantiated.
- Code
E0110- Severity
- error
- Message
Abstract class {} with abstract methods instantiated
Used when the first argument to reversed() builtin isn't a sequence (does not implement __reversed__, nor __getitem__ and __len__. pylint calls it bad-reversed-sequence.
- Code
E0111- Severity
- error
- Message
The first reversed() argument is not a sequence
According to PEP 8, 4 spaces per indentation level should be preferred. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E111- Message
Indentation is not a multiple of {}
Emitted when there are more than one starred expressions (*x) in an assignment. This is a SyntaxError. pylint calls it too-many-star-expressions.
- Code
E0112- Severity
- error
- Message
More than one starred expression in assignment
All indented blocks should be indented; otherwise, they are not valid Python syntax. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E112- Message
Expected an indented block
Emitted when a star expression is used as a starred assignment target. pylint calls it invalid-star-assignment-target.
- Code
E0113- Severity
- error
- Message
Starred assignment target must be in a list or tuple
Indentation outside of a code block is not valid Python syntax. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E113- Message
Unexpected indentation
Emitted when a star expression is not used in an assignment target. pylint calls it star-needs-assignment-target.
- Code
E0114- Severity
- error
- Message
Can use starred expression only in assignment target
According to PEP 8, 4 spaces per indentation level should be preferred. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E114- Message
Indentation is not a multiple of {} (comment)
Emitted when a name is both nonlocal and global. pylint calls it nonlocal-and-global.
- Code
E0115- Severity
- error
- Message
Name {} is nonlocal and global
Comments within an indented block should themselves be indented, to indicate that they are part of the block. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E115- Message
Expected an indented block (comment)
Comments should match the indentation of the containing code block. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E116- Message
Unexpected indentation (comment)
Emitted when a nonlocal variable does not have an attached name somewhere in the parent scopes. pylint calls it nonlocal-without-binding.
- Code
E0117- Severity
- error
- Message
nonlocal name {} found without binding
According to PEP 8, 4 spaces per indentation level should be preferred. Increased indentation can lead to inconsistent formatting, which can hurt readability. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E117- Message
Over-indented (comment)- Message
Over-indented
Emitted when a name is used prior a global declaration, which results in an error since Python 3.6. This message can't be emitted when using Python < 3.6. pylint calls it used-prior-global-declaration.
- Code
E0118- Severity
- error
- Message
Name {} is used prior to global declaration
Emitted when format function is not called on str object. e.g doing print("value: {}").format(123) instead of print("value: {}".format(123)). This might not be what the user intended to do. pylint calls it misplaced-format-function.
- Code
E0119- Severity
- error
- Message
format function is not called on str
PEP 8 recommends the omission of whitespace in the following cases: - "Immediately inside parentheses, brackets or braces." - "Immediately before a comma, semicolon, or colon." Ruff takes this rule from pycodestyle. It is in preview.
- Code
E201- Message
Whitespace after '{}'
Used when a class defines a method which is hidden by an instance attribute from an ancestor class or set by some client code. pylint calls it method-hidden.
- Code
E0202- Severity
- error
- Message
An attribute defined in {} line {} hides this method
PEP 8 recommends the omission of whitespace in the following cases: - "Immediately inside parentheses, brackets or braces." - "Immediately before a comma, semicolon, or colon." Ruff takes this rule from pycodestyle. It is in preview.
- Code
E202- Message
Whitespace before '{}'
Used when an instance member is accessed before it's actually assigned. pylint calls it access-member-before-definition.
- Code
E0203- Severity
- error
- Message
Access to member {} before its definition line {}
PEP 8 recommends the omission of whitespace in the following cases: - "Immediately inside parentheses, brackets or braces." - "Immediately before a comma, semicolon, or colon." Ruff takes this rule from pycodestyle. It is in preview.
- Code
E203- Message
Whitespace before '{}'
Including whitespace after the @ symbol is not compliant with PEP 8. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E204- Message
Whitespace after decorator
Used when a method which should have the bound instance as first argument has no argument defined. pylint calls it no-method-argument.
- Code
E0211- Severity
- error
- Message
Method {} has no argument
According to PEP 8, open parentheses and brackets should not be preceded by any trailing whitespace. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E211- Message
Whitespace before '{}'
Used when a method has an attribute different the "self" as first argument. This is considered as an error since this is a so common convention that you shouldn't break it!. pylint calls it no-self-argument.
- Code
E0213- Severity
- error
- Message
Method {} should have "self" as first argument
According to PEP 8, operators should be surrounded by at most a single space on either side. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E221- Message
Multiple spaces before operator
According to PEP 8, operators should be surrounded by at most a single space on either side. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E222- Message
Multiple spaces after operator
According to PEP 8, operators should be surrounded by at most a single space on either side. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E223- Message
Tab before operator
According to PEP 8, operators should be surrounded by at most a single space on either side. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E224- Message
Tab after operator
According to PEP 8, there should be one space before and after all assignment (=), augmented assignment (+=, -=, etc.), comparison, and Booleans operators. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E225- Message
Missing whitespace around operator
PEP 8 recommends never using more than one space, and always having the same amount of whitespace on both sides of a binary operator. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E226- Message
Missing whitespace around arithmetic operator
PEP 8 recommends never using more than one space, and always having the same amount of whitespace on both sides of a binary operator. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E227- Message
Missing whitespace around bitwise or shift operator
PEP 8 recommends never using more than one space, and always having the same amount of whitespace on both sides of a binary operator. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E228- Message
Missing whitespace around modulo operator
Missing whitespace after ,, ;, and : makes the code harder to read. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E231- Message
Missing whitespace after {}
Used when an invalid (non-string) object occurs in __slots__. pylint calls it invalid-slots-object.
- Code
E0236- Severity
- error
- Message
Invalid object {} in __slots__, must contain only non empty strings
Used when assigning to an attribute not defined in the class slots. pylint calls it assigning-non-slot.
- Code
E0237- Severity
- error
- Message
Assigning to attribute {} not defined in class slots
Used when an invalid __slots__ is found in class. Only a string, an iterable or a sequence is permitted. pylint calls it invalid-slots.
- Code
E0238- Severity
- error
- Message
Invalid __slots__ object
Used when a class inherits from something which is not a class. pylint calls it inherit-non-class.
- Code
E0239- Severity
- error
- Message
Inheriting {}, which is not a class.
Used when a class has an inconsistent method resolution order. pylint calls it inconsistent-mro.
- Code
E0240- Severity
- error
- Message
Inconsistent method resolution order for class {}
Duplicate use of base classes in derived classes raise TypeErrors. pylint calls it duplicate-bases.
- Code
E0241- Severity
- error
- Message
Duplicate bases for class {}
Consistency is good. This rule helps ensure you have a consistent formatting style across your project. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E241- Message
Multiple spaces after comma
Used when a value in __slots__ conflicts with a class variable, property or method. pylint calls it class-variable-slots-conflict.
- Code
E0242- Severity
- error
- Message
Value {} in slots conflicts with class variable
Commas should be followed by one space, never tabs. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E242- Message
Tab after comma
Used when an invalid object is assigned to a __class__ property. Only a class is permitted. pylint calls it invalid-class-object.
- Code
E0243- Severity
- error
- Message
Invalid assignment to '__class__'. Should be a class definition but got a '{}'
Used when a class tries to extend an inherited Enum class. Doing so will raise a TypeError at runtime. pylint calls it invalid-enum-extension.
- Code
E0244- Severity
- error
- Message
Extending inherited Enum class "{}"
Raised when a type annotation on a class is absent from the list of names in __slots__, and __slots__ does not contain a __dict__ entry. pylint calls it declare-non-slot.
- Code
E0245- Severity
- error
- Message
No such name {} in __slots__
According to PEP 8, there should be no spaces around the equals sign in a keyword parameter, if it is unannotated: Ruff takes this rule from pycodestyle. It is in preview.
- Code
E251- Message
Unexpected spaces around keyword / parameter equals
According to PEP 8, the spaces around the equals sign in a keyword parameter should only be omitted when the parameter is unannotated: Ruff takes this rule from pycodestyle. It is in preview.
- Code
E252- Message
Missing whitespace around parameter equals
An inline comment is a comment on the same line as a statement. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E261- Message
Insert at least two spaces before an inline comment
An inline comment is a comment on the same line as a statement. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E262- Message
Inline comment should start with `# `
Per PEP 8, "Block comments generally consist of one or more paragraphs built out of complete sentences, with each sentence ending in a period." Ruff takes this rule from pycodestyle. It is in preview.
- Code
E265- Message
Block comment should start with `# `
Per PEP 8, "Block comments generally consist of one or more paragraphs built out of complete sentences, with each sentence ending in a period." Ruff takes this rule from pycodestyle. It is in preview.
- Code
E266- Message
Too many leading `#` before block comment
Ruff takes this rule from pycodestyle. It is in preview.
- Code
E271- Message
Multiple spaces after keyword
Ruff takes this rule from pycodestyle. It is in preview.
- Code
E272- Message
Multiple spaces before keyword
Ruff takes this rule from pycodestyle. It is in preview.
- Code
E273- Message
Tab after keyword
Ruff takes this rule from pycodestyle. It is in preview.
- Code
E274- Message
Tab before keyword
Missing whitespace after keywords makes the code harder to read. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E275- Message
Missing whitespace after keyword
Used when an __iter__ method returns something which is not an iterable (i.e. has no __next__ method). pylint calls it non-iterator-returned.
- Code
E0301- Severity
- error
- Message
__iter__ returns non-iterator
PEP 8 recommends exactly one blank line between methods of a class. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E301- Message
Expected {BLANK_LINES_NESTED_LEVEL:?} blank line, found 0
Emitted when a special method was defined with an invalid number of parameters. If it has too few or too many, it might not work at all. pylint calls it unexpected-special-method-signature.
- Code
E0302- Severity
- error
- Message
The special method {} expects {} param(s), {} {} given
PEP 8 recommends exactly two blank lines between top level functions and classes. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E302- Message
Expected {expected_blank_lines:?} blank lines, found {}
Used when a __len__ method returns something which is not a non-negative integer. pylint calls it invalid-length-returned.
- Code
E0303- Severity
- error
- Message
__len__ does not return non-negative integer
PEP 8 recommends using blank lines as follows: - No more than two blank lines between top-level statements. - No more than one blank line between non-top-level statements. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E303- Message
Too many blank lines ({})
Used when a __bool__ method returns something which is not a bool. pylint calls it invalid-bool-returned.
- Code
E0304- Severity
- error
- Message
__bool__ does not return bool
There should be no blank lines between a decorator and the object it is decorating. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E304- Message
Blank lines found after function decorator ({})
Used when an __index__ method returns something which is not an integer. pylint calls it invalid-index-returned.
- Code
E0305- Severity
- error
- Message
__index__ does not return int
PEP 8 recommends using blank lines as follows: - Two blank lines are expected between functions and classes - One blank line is expected between methods of a class. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E305- Message
Expected 2 blank lines after class or function definition, found ({})
Used when a __repr__ method returns something which is not a string. pylint calls it invalid-repr-returned.
- Code
E0306- Severity
- error
- Message
__repr__ does not return str
PEP 8 recommends using blank lines as follows: - Two blank lines are expected between functions and classes - One blank line is expected between methods of a class. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E306- Message
Expected 1 blank line before a nested definition, found 0
Used when a __str__ method returns something which is not a string. pylint calls it invalid-str-returned.
- Code
E0307- Severity
- error
- Message
__str__ does not return str
Used when a __bytes__ method returns something which is not bytes. pylint calls it invalid-bytes-returned.
- Code
E0308- Severity
- error
- Message
__bytes__ does not return bytes
Used when a __hash__ method returns something which is not an integer. pylint calls it invalid-hash-returned.
- Code
E0309- Severity
- error
- Message
__hash__ does not return int
Used when a __length_hint__ method returns something which is not a non-negative integer. pylint calls it invalid-length-hint-returned.
- Code
E0310- Severity
- error
- Message
__length_hint__ does not return non-negative integer
Used when a __format__ method returns something which is not a string. pylint calls it invalid-format-returned.
- Code
E0311- Severity
- error
- Message
__format__ does not return str
Used when a __getnewargs__ method returns something which is not a tuple. pylint calls it invalid-getnewargs-returned.
- Code
E0312- Severity
- error
- Message
__getnewargs__ does not return a tuple
Used when a __getnewargs_ex__ method returns something which is not of the form tuple(tuple, dict). pylint calls it invalid-getnewargs-ex-returned.
- Code
E0313- Severity
- error
- Message
__getnewargs_ex__ does not return a tuple containing (tuple, dict)
Used when pylint has been unable to import a module. pylint calls it import-error.
- Code
E0401- Severity
- error
- Message
Unable to import {}
According to PEP 8, "imports should usually be on separate lines." Ruff takes this rule from pycodestyle and made it stable in v0.0.191.
- Code
E401- Message
Multiple imports on one line
Used when a relative import tries to access too many levels in the current package. pylint calls it relative-beyond-top-level.
- Code
E0402- Severity
- error
- Message
Attempted relative import beyond top-level package
According to PEP 8, "imports are always put at the top of the file, just after any module comments and docstrings, and before module globals and constants." Ruff takes this rule from pycodestyle and made it stable in v0.0.28.
- Code
E402- Message
Module level import not at top of cell- Message
Module level import not at top of file
Emitted when a PEP 810 lazy import is used where Python forbids it: inside a function, a class body or a try statement, or as a wildcard import. This is a SyntaxError. This message can't be emitted when using Python < 3.15. pylint calls it invalid-lazy-import.
- Code
E0403- Severity
- error
- Message
Lazy import is not allowed {}
Overlong lines can hurt readability. PEP 8, for example, recommends limiting lines to 79 characters. By default, this rule enforces a limit of 88 characters for compatibility with Black and the Ruff formatter, though that limit is configurable via the line-length setting. Ruff takes this rule from pycodestyle and made it stable in v0.0.18.
- Code
E501- Message
Line too long ({} > {})
Explicit line joins using a backslash are redundant between brackets. Ruff takes this rule from pycodestyle. It is in preview.
- Code
E502- Message
Redundant backslash
Emitted when a local variable is accessed before its assignment took place. Assignments in try blocks are assumed not to have occurred when evaluating associated except/finally blocks. Assignments in except blocks are assumed not to have occurred when evaluating statements outside the block, except when the associated try block contains a return statement. pylint calls it used-before-assignment.
- Code
E0601- Severity
- error
- Message
Using variable {} before assignment
Used when an undefined variable is accessed. pylint calls it undefined-variable.
- Code
E0602- Severity
- error
- Message
Undefined variable {}
Used when an undefined variable name is referenced in __all__. pylint calls it undefined-all-variable.
- Code
E0603- Severity
- error
- Message
Undefined variable name {} in __all__
Used when an invalid (non-string) object occurs in __all__. pylint calls it invalid-all-object.
- Code
E0604- Severity
- error
- Message
Invalid object {} in __all__, must contain only strings
Used when __all__ has an invalid format. pylint calls it invalid-all-format.
- Code
E0605- Severity
- error
- Message
Invalid format for __all__, must be tuple or list
Emitted when a local variable is accessed before its assignment took place in both branches of an if/else switch. pylint calls it possibly-used-before-assignment.
- Code
E0606- Severity
- error
- Message
Possibly using variable {} before assignment
Used when a name cannot be found in a module. pylint calls it no-name-in-module.
- Code
E0611- Severity
- error
- Message
No name {} in module {}
Used when something which is not a sequence is used in an unpack assignment. pylint calls it unpacking-non-sequence.
- Code
E0633- Severity
- error
- Message
Attempting to unpack a non-sequence{}
Emitted when an index used on an iterable goes beyond the length of that iterable. pylint calls it potential-index-error.
- Code
E0643- Severity
- error
- Message
Invalid index for iterable length
Used when except clauses are not in the correct order (from the more specific to the more generic). If you don't fix the order, some exceptions may not be caught by the most specific handler. pylint calls it bad-except-order.
- Code
E0701- Severity
- error
- Message
Bad except clauses order ({})
According to PEP 8, "compound statements are generally discouraged". Ruff takes this rule from pycodestyle and made it stable in v0.0.245.
- Code
E701- Message
Multiple statements on one line (colon)
Used when something which is neither a class nor an instance is raised (i.e. a TypeError will be raised). pylint calls it raising-bad-type.
- Code
E0702- Severity
- error
- Message
Raising {} while only classes or instances are allowed
According to PEP 8, including multi-clause statements on the same line is discouraged. Ruff takes this rule from pycodestyle and made it stable in v0.0.245.
- Code
E702- Message
Multiple statements on one line (semicolon)
A trailing semicolon is unnecessary and should be removed. Ruff takes this rule from pycodestyle and made it stable in v0.0.245.
- Code
E703- Message
Statement ends with an unnecessary semicolon
Used when a bare raise is not used inside an except clause. This generates an error, since there are no active exceptions to be reraised. An exception to this rule is represented by a bare raise inside a finally clause, which might work, as long as an exception is raised inside the try block, but it is nevertheless a code smell that must not be relied upon. pylint calls it misplaced-bare-raise.
- Code
E0704- Severity
- error
- Message
The raise statement is not inside an except clause
Used when using the syntax "raise ... from ...", where the exception cause is not an exception, nor None. pylint calls it bad-exception-cause.
- Code
E0705- Severity
- error
- Message
Exception cause set to something which is not an exception, nor None
Used when a class which doesn't inherit from BaseException is raised. pylint calls it raising-non-exception.
- Code
E0710- Severity
- error
- Message
Raising a class which doesn't inherit from BaseException
Used when NotImplemented is raised instead of NotImplementedError. pylint calls it notimplemented-raised.
- Code
E0711- Severity
- error
- Message
NotImplemented raised - should raise NotImplementedError
According to PEP 8, "Comparisons to singletons like None should always be done with is or is not, never the equality operators." Ruff takes this rule from pycodestyle and made it stable in v0.0.28.
- Code
E711- Message
Comparison to `None` should be `cond is None`- Message
Comparison to `None` should be `cond is not None`
Used when a class which doesn't inherit from Exception is used as an exception in an except clause. pylint calls it catching-non-exception.
- Code
E0712- Severity
- error
- Message
Catching an exception which doesn't inherit from Exception: {}
PEP 8 recommends against using the equality operators == and != to compare values to True or False. Ruff takes this rule from pycodestyle and made it stable in v0.0.28.
- Code
E712- Message
Avoid equality comparisons to `True`; use `{}:` for truth checks- Message
Avoid inequality comparisons to `True`; use `not {}:` for false checks- Message
Avoid equality comparisons to `False`; use `not {}:` for false checks- Message
Avoid inequality comparisons to `False`; use `{}:` for truth checks
Testing membership with {element} not in {collection} is more readable. Ruff takes this rule from pycodestyle and made it stable in v0.0.28.
- Code
E713- Message
Test for membership should be `not in`
According to PEP8, testing for an object's identity with is not is more readable. Ruff takes this rule from pycodestyle and made it stable in v0.0.28.
- Code
E714- Message
Test for object identity should be `is not`
Unlike a direct type comparison, isinstance will also check if an object is an instance of a class or a subclass thereof. Ruff takes this rule from pycodestyle and made it stable in v0.0.39.
- Code
E721- Message
Use `is` and `is not` for type comparisons, or `isinstance()` for isinstance checks
A bare except catches BaseException which includes KeyboardInterrupt, SystemExit, Exception, and others. Catching BaseException can make it hard to interrupt the program (e.g., with Ctrl-C) and can disguise other problems. Ruff takes this rule from pycodestyle and made it stable in v0.0.36.
- Code
E722- Message
Do not use bare `except`
Per PEP 8, you should "Always use a def statement instead of an assignment statement that binds a lambda expression directly to an identifier." Ruff takes this rule from pycodestyle and made it stable in v0.0.28.
- Code
E731- Message
Do not assign a `lambda` expression, use a `def`
In some fonts, these characters are indistinguishable from the numerals one and zero. When tempted to use 'l', use 'L' instead. Ruff takes this rule from pycodestyle and made it stable in v0.0.34.
- Code
E741- Message
Ambiguous variable name: `{}`
In some fonts, these characters are indistinguishable from the numerals one and zero. When tempted to use 'l', use 'L' instead. Ruff takes this rule from pycodestyle and made it stable in v0.0.35.
- Code
E742- Message
Ambiguous class name: `{}`
In some fonts, these characters are indistinguishable from the numerals one and zero. When tempted to use 'l', use 'L' instead. Ruff takes this rule from pycodestyle and made it stable in v0.0.35.
- Code
E743- Message
Ambiguous function name: `{}`
An IOError indicates an error in the development setup. For example, the user may not have permissions to read a given file, or the filesystem may contain a broken symlink. Ruff takes this rule from pycodestyle and made it stable in v0.0.28.
- Code
E902- Message
{}
Code with syntax errors cannot be executed. Such errors are likely a mistake. Ruff takes this rule from pycodestyle, and removed it.
- Code
E999- Message
SyntaxError
Used when another argument than the current class is given as first argument of the super builtin. pylint calls it bad-super-call.
- Code
E1003- Severity
- error
- Message
Bad first argument {} given to super()
Used when a variable is accessed for a nonexistent member. pylint calls it no-member.
- Code
E1101- Severity
- error
- Message
{} {} has no {} member{}
Used when an object being called has been inferred to a non callable object. pylint calls it not-callable.
- Code
E1102- Severity
- error
- Message
{} is not callable
Used when an assignment is done on a function call but the inferred function doesn't return anything. pylint calls it assignment-from-no-return.
- Code
E1111- Severity
- error
- Message
Assigning result of a function call, but {} returns None{}
Used when a function call passes too few arguments. pylint calls it no-value-for-parameter.
- Code
E1120- Severity
- error
- Message
No value for argument {} in {} call
Used when a function call passes too many positional arguments. pylint calls it too-many-function-args.
- Code
E1121- Severity
- error
- Message
Too many positional arguments for {} call
Used when a function call passes a keyword argument that doesn't correspond to one of the function's parameter names. pylint calls it unexpected-keyword-arg.
- Code
E1123- Severity
- error
- Message
Unexpected keyword argument {} in {} call
Used when a function call would result in assigning multiple values to a function parameter, one value from a positional argument and one from a keyword argument. pylint calls it redundant-keyword-arg.
- Code
E1124- Severity
- error
- Message
Argument {} passed by position and keyword in {} call
Used when a function call does not pass a mandatory keyword-only argument. pylint calls it missing-kwoa.
- Code
E1125- Severity
- error
- Message
Missing mandatory keyword argument {} in {} call
Used when a sequence type is indexed with an invalid type. Valid types are ints, slices, and objects with an __index__ method. pylint calls it invalid-sequence-index.
- Code
E1126- Severity
- error
- Message
Sequence index is not an int, slice, or instance with __index__
Used when a slice index is not an integer, None, or an object with an __index__ method. pylint calls it invalid-slice-index.
- Code
E1127- Severity
- error
- Message
Slice index is not an int, None, or instance with __index__
Used when an assignment is done on a function call but the inferred function returns nothing but None. pylint calls it assignment-from-none.
- Code
E1128- Severity
- error
- Message
Assigning result of a function call, where the function returns None
Used when an instance in a with statement doesn't implement the context manager protocol(__enter__/__exit__). pylint calls it not-context-manager.
- Code
E1129- Severity
- error
- Message
Context manager '{}' doesn't implement __enter__ and __exit__.
Emitted when a function call got multiple values for a keyword. pylint calls it repeated-keyword.
- Code
E1132- Severity
- error
- Message
Got multiple values for keyword argument {} in function call
Used when a non-iterable value is used in place where iterable is expected. pylint calls it not-an-iterable.
- Code
E1133- Severity
- error
- Message
Non-iterable value {} is used in an iterating context
Used when a non-mapping value is used in place where mapping is expected. pylint calls it not-a-mapping.
- Code
E1134- Severity
- error
- Message
Non-mapping value {} is used in a mapping context
Emitted when an instance in membership test expression doesn't implement membership protocol (__contains__/__iter__/__getitem__). pylint calls it unsupported-membership-test.
- Code
E1135- Severity
- error
- Message
Value '{}' doesn't support membership test
Emitted when a subscripted value doesn't support subscription (i.e. doesn't define __getitem__ method or __class_getitem__ for a class). pylint calls it unsubscriptable-object.
- Code
E1136- Severity
- error
- Message
Value '{}' is unsubscriptable
Emitted when an object does not support item assignment (i.e. doesn't define __setitem__ method). pylint calls it unsupported-assignment-operation.
- Code
E1137- Severity
- error
- Message
{} does not support item assignment
Emitted when an object does not support item deletion (i.e. doesn't define __delitem__ method). pylint calls it unsupported-delete-operation.
- Code
E1138- Severity
- error
- Message
{} does not support item deletion
Emitted whenever we can detect that a class is using, as a metaclass, something which might be invalid for using as a metaclass. pylint calls it invalid-metaclass.
- Code
E1139- Severity
- error
- Message
Invalid metaclass {} used
Emitted when trying to iterate through a dict without calling .items(). pylint calls it dict-iter-missing-items.
- Code
E1141- Severity
- error
- Message
Unpacking a dictionary in iteration without calling .items()
Emitted when await is used outside an async function. pylint calls it await-outside-async.
- Code
E1142- Severity
- error
- Message
'await' should be used within an async function