General
- A byte literal contains a non-ASCII character
Reports characters in byte literals that are outside ASCII range.
- Attempt to call a non-callable object
Reports a problem when you are trying to call objects that are not callable, like, for example, properties:.
- Class-specific decorator is used outside the class
Reports usages of @classmethod or @staticmethod decorators in methods outside a class.
- Code is incompatible with specific Python versions
Reports incompatibility with the specified versions of Python.
- Deprecated function, class, or module
Reports usages of Python functions, or methods that are marked as deprecated and raise the DeprecationWarning or PendingDeprecationWarning warning.
- Dictionary contains duplicate keys
Reports using the same value as the dictionary key twice.
- Division by zero
Reports division operations (/, //, %, divmod()) where the divisor is always zero, which raises an error at runtime, for example ZeroDivisionError.
- Errors in string formatting operations
Reports errors in string formatting operations.
- File contains non-ASCII character
Reports cases in Python 2 when a file contains non-ASCII characters and does not have an encoding declaration at the top.
- Global variable is not defined at the module level
Reports problems when a variable defined through the global statement is not defined in the module scope.
- Improper position of from '__future__' import
Reports from __future__ import statements that are used not at the beginning of a file.
- Inconsistent indentation
Reports inconsistent indentation in Python source files when, for example, you use a mixture of tabs and spaces in your code.
- Incorrect call arguments
Reports discrepancies between declared parameters and actual arguments, as well as incorrect arguments, for example, duplicate named arguments, and incorrect argument order.
- Invalid escape sequence
Reports invalid escape sequences in string and bytes literals.
- Invalid pattern in pattern matching
Reports incorrect or ambiguous use of structural pattern matching in Python class patterns and __match_args__ definitions.
- Invalid use of 'lazy' import
Reports invalid uses of lazy imports introduced by PEP 810.
- No encoding specified for file
Reports a missing encoding comment in Python 2.
- Problematic nesting of decorators
Reports problems with nesting decorators.
- Pydantic dataclass
Pydantic dataclass/model configuration problems Reports incorrect or unsafe configuration of pydantic dataclasses and models that are discovered via the PEP 681 dataclass_transform mechanism.
- Pydantic field constraint violation
Reports arguments passed to a Pydantic model constructor that violate Field constraints.
- Redeclared names without usages
Reports unconditional redeclarations of names without being used in between.
- Shadowing built-in names
.
- Shadowing names from outer scopes
Reports shadowing names defined in outer scopes.
- String conversion without dunder method
Reports when a type that doesn't define __str__, __repr__, or __format__ is converted to a string.
- Suspicious relative imports
Reports usages of relative imports inside plain directories, for example, directories neither containing __init__.py nor explicitly marked as namespace packages.
- The default argument is mutable
Reports a problem when a mutable value as a list or dictionary is detected in a default value for an argument.
- Unhashable values in dictionary keys and set elements
Reports unhashable expressions used as dictionary keys, set values, or hash arguments.
- Unresolved references
Reports references in your code that cannot be resolved.
- Using function calls that don't return anything as values
Reports cases when the result of a function that does not return anything is used.