Emitted when a dict key or set member is not hashable (i.e. doesn't define __hash__ method). pylint calls it unhashable-member.
- Code
E1143- Severity
- error
- Message
'{}' is unhashable and can't be used as a {} in a {}
Used when a slice step is 0 and the object doesn't implement a custom __getitem__ method. pylint calls it invalid-slice-step.
- Code
E1144- Severity
- error
- Message
Slice step cannot be 0
Used when an async context manager is used with a regular 'with' statement instead of 'async with'. pylint calls it async-context-manager-with-regular-with.
- Code
E1145- Severity
- error
- Message
Context manager '{}' is async and should be used with 'async with'.
Used when an unsupported format character is used in a logging statement format string. pylint calls it logging-unsupported-format.
- Code
E1200- Severity
- error
- Message
Unsupported logging format character {} (%#02x) at index {}
Used when a logging statement format string terminates before the end of a conversion specifier. pylint calls it logging-format-truncated.
- Code
E1201- Severity
- error
- Message
Logging format string ends in middle of conversion specifier
Used when a logging format string is given too many arguments. pylint calls it logging-too-many-args.
- Code
E1205- Severity
- error
- Message
Too many arguments for logging format string
Used when a logging format string is given too few arguments. pylint calls it logging-too-few-args.
- Code
E1206- Severity
- error
- Message
Not enough arguments for logging format string
Used when an unsupported format character is used in a format string. pylint calls it bad-format-character.
- Code
E1300- Severity
- error
- Message
Unsupported format character {} (%#02x) at index {}
Used when a format string terminates before the end of a conversion specifier. pylint calls it truncated-format-string.
- Code
E1301- Severity
- error
- Message
Format string ends in middle of conversion specifier
Used when a format string contains both named (e.g. '%(foo)d') and unnamed (e.g. '%d') conversion specifiers. This is also used when a named conversion specifier contains * for the minimum field width and/or precision. pylint calls it mixed-format-string.
- Code
E1302- Severity
- error
- Message
Mixing named and unnamed conversion specifiers in format string
Used when a format string that uses named conversion specifiers is used with an argument that is not a mapping. pylint calls it format-needs-mapping.
- Code
E1303- Severity
- error
- Message
Expected mapping for format string, not {}
Used when a format string that uses named conversion specifiers is used with a dictionary that doesn't contain all the keys required by the format string. pylint calls it missing-format-string-key.
- Code
E1304- Severity
- error
- Message
Missing key {} in format string dictionary
Used when a format string that uses unnamed conversion specifiers is given too many arguments. pylint calls it too-many-format-args.
- Code
E1305- Severity
- error
- Message
Too many arguments for format string
Used when a format string that uses unnamed conversion specifiers is given too few arguments. pylint calls it too-few-format-args.
- Code
E1306- Severity
- error
- Message
Not enough arguments for format string
Used when a type required by format string is not suitable for actual argument type. pylint calls it bad-string-format-type.
- Code
E1307- Severity
- error
- Message
Argument {} does not match format type {}
The argument to a str.{l,r,}strip call contains a duplicate character. pylint calls it bad-str-strip-call.
- Code
E1310- Severity
- error
- Message
Suspicious argument in {}.{} call
Env manipulation functions support only string type arguments. See https://docs.python.org/3/library/os.html#os.getenv. pylint calls it invalid-envvar-value.
- Code
E1507- Severity
- error
- Message
{} does not support {} type argument
Singledispatch should decorate functions and not class/instance methods. Use singledispatchmethod for those cases. pylint calls it singledispatch-method.
- Code
E1519- Severity
- error
- Message
singledispatch decorator should not be used with methods, use singledispatchmethod instead.
Singledispatchmethod should decorate class/instance methods and not functions. Use singledispatch for those cases. pylint calls it singledispatchmethod-function.
- Code
E1520- Severity
- error
- Message
singledispatchmethod decorator should not be used with functions, use singledispatch instead.
Used when an yield or yield from statement is found inside an async function. This message can't be emitted when using Python < 3.5. pylint calls it yield-inside-async-function.
- Code
E1700- Severity
- error
- Message
Yield inside async function
Used when an async context manager is used with an object that does not implement the async context management protocol. This message can't be emitted when using Python < 3.5. pylint calls it not-async-context-manager.
- Code
E1701- Severity
- error
- Message
Async context manager '{}' doesn't implement __aenter__ and __aexit__.
Emitted when a name capture pattern is used in a match statement and there are case statements below it. pylint calls it bare-name-capture-pattern.
- Code
E1901- Severity
- error
- Message
The name capture `case {}` makes the remaining patterns unreachable. Use a dotted name (for example an enum) to fix this.
Emitted if __match_args__ isn't a tuple of strings required for match. pylint calls it invalid-match-args-definition.
- Code
E1902- Severity
- error
- Message
`__match_args__` must be a tuple of strings.
Emitted when the number of allowed positional sub-patterns exceeds the number of allowed sub-patterns specified in __match_args__. pylint calls it too-many-positional-sub-patterns.
- Code
E1903- Severity
- error
- Message
{} expects {} positional sub-patterns (given {})
Emitted when there is more than one sub-pattern for a specific attribute in a class pattern. pylint calls it multiple-class-sub-patterns.
- Code
E1904- Severity
- error
- Message
Multiple sub-patterns for attribute {}
For compatibility use UTF-8 instead of UTF-16/UTF-32. See also https://bugs.python.org/issue1503789 for a history of this issue. And https://softwareengineering.stackexchange.com/questions/102205/ for some possible problems when using UTF-16 for instance. pylint calls it invalid-unicode-codec.
- Code
E2501- Severity
- error
- Message
UTF-16 and UTF-32 aren't backward compatible. Use UTF-8 instead
Bidirectional unicode are typically not displayed characters required to display right-to-left (RTL) script (i.e. Chinese, Japanese, Arabic, Hebrew, ...) correctly. So can you trust this code? Are you sure it displayed correctly in all editors? If you did not write it or your language is not RTL, remove the special characters, as they could be used to trick you into executing code, that does something else than what it looks like. More Information: https://en.wikipedia.org/wiki/Bidirectional_text https://trojansource.codes/. pylint calls it bidirectional-unicode.
- Code
E2502- Severity
- error
- Message
Contains control characters that can permit obfuscated code executed differently than displayed
Moves the cursor back, so the character after it will overwrite the character before. pylint calls it invalid-character-backspace.
- Code
E2510- Severity
- error
- Message
Invalid unescaped character backspace, use "b" instead.
Moves the cursor to the start of line, subsequent characters overwrite the start of the line. pylint calls it invalid-character-carriage-return.
- Code
E2511- Severity
- error
- Message
Invalid unescaped character carriage-return, use "r" instead.
Ctrl+Z "End of text" on Windows. Some programs (such as type) ignore the rest of the file after it. pylint calls it invalid-character-sub.
- Code
E2512- Severity
- error
- Message
Invalid unescaped character sub, use "x1A" instead.
Commonly initiates escape codes which allow arbitrary control of the terminal. pylint calls it invalid-character-esc.
- Code
E2513- Severity
- error
- Message
Invalid unescaped character esc, use "x1B" instead.
Mostly end of input for python. pylint calls it invalid-character-nul.
- Code
E2514- Severity
- error
- Message
Invalid unescaped character nul, use "0" instead.
Invisible space character could hide real code execution. pylint calls it invalid-character-zero-width-space.
- Code
E2515- Severity
- error
- Message
Invalid unescaped character zero-width-space, use "u200B" instead.
Emitted when positional-only arguments have been passed as keyword arguments. Remove the keywords for the affected arguments in the function call. pylint calls it positional-only-arguments-expected.
- Code
E3102- Severity
- error
- Message
`{}()` got some positional-only arguments passed as keyword arguments: {}
The dataclasses.field() specifier should only be used as the value of an assignment within a dataclass, or within the make_dataclass() function. pylint calls it invalid-field-call.
- Code
E3701- Severity
- error
- Message
Invalid usage of field(), {}
Emitted when items are added or removed to a dict being iterated through. Doing so raises a RuntimeError. pylint calls it modified-iterating-dict.
- Code
E4702- Severity
- error
- Message
Iterated dict '{}' is being modified inside for loop body, iterate through a copy of it instead.
Emitted when items are added or removed to a set being iterated through. Doing so raises a RuntimeError. pylint calls it modified-iterating-set.
- Code
E4703- Severity
- error
- Message
Iterated set '{}' is being modified inside for loop body, iterate through a copy of it instead.
Python includes the raise in the default traceback (and formatters like Rich and IPython do too). Ruff takes this rule from flake8-errmsg and made it stable in v0.0.183.
- Code
EM101- Message
Exception must not use a string literal, assign to variable first
Python includes the raise in the default traceback (and formatters like Rich and IPython do too). Ruff takes this rule from flake8-errmsg and made it stable in v0.0.183.
- Code
EM102- Message
Exception must not use an f-string literal, assign to variable first
Python includes the raise in the default traceback (and formatters like Rich and IPython do too). Ruff takes this rule from flake8-errmsg and made it stable in v0.0.183.
- Code
EM103- Message
Exception must not use a `.format()` string directly, assign to variable first
This error code is similar to the [return] code but is emitted specifically for functions and methods with empty bodies (if they are annotated with non-trivial return type). Such a distinction exists because in some contexts an empty body can be valid, for example for an abstract method or in a stub file. mypy enables this error code by default.
- Code
empty-body- Severity
- error
Commented-out code is dead code, and is often included inadvertently. It should be removed. Ruff takes this rule from eradicate and made it stable in v0.0.145.
- Code
ERA001- Message
Found commented-out code
In Python, a shebang (also known as a hashbang) is the first line of a script, which specifies the interpreter that should be used to run the script. Ruff takes this rule from flake8-executable and made it stable in v0.0.233.
- Code
EXE001- Message
Shebang is present but file is not executable
In Python, a shebang (also known as a hashbang) is the first line of a script, which specifies the interpreter that should be used to run the script. Ruff takes this rule from flake8-executable and made it stable in v0.0.233.
- Code
EXE002- Message
The file is executable but no shebang is present
In Python, a shebang (also known as a hashbang) is the first line of a script, which specifies the command that should be used to run the script. Ruff takes this rule from flake8-executable and made it stable in v0.0.229.
- Code
EXE003- Message
Shebang should contain `python`, `pytest`, or `uv run`
In Python, a shebang (also known as a hashbang) is the first line of a script, which specifies the interpreter that should be used to run the script. Ruff takes this rule from flake8-executable and made it stable in v0.0.229.
- Code
EXE004- Message
Avoid whitespace before shebang
In Python, a shebang (also known as a hashbang) is the first line of a script, which specifies the interpreter that should be used to run the script. Ruff takes this rule from flake8-executable and made it stable in v0.0.229.
- Code
EXE005- Message
Shebang should be at the beginning of the file
If enabled with --enable-error-code exhaustive-match, mypy generates an error if a match statement does not match all possible cases/types. mypy does not enable this error code by default. Use --enable-error-code exhaustive-match to enable it.
- Code
exhaustive-match- Severity
- error
If mypy can determine that :py__exit__ always returns False, mypy checks that the return type is *not* bool. The boolean value of the return type affects which lines mypy thinks are reachable after a with statement, since any :py__exit__ method that can return True may swallow exceptions. mypy enables this error code by default.
- Code
exit-return- Severity
- error
If you use --disallow-any-explicit, mypy generates an error if you use an explicit Any type annotation. mypy does not enable this error code by default. Use --enable-error-code explicit-any to enable it.
- Code
explicit-any- Severity
- error
If you use --enable-error-code explicit-override mypy generates an error if you override a base class method without using the @override decorator. An error will not be emitted for overrides of __init__ or __new__. See PEP 698. mypy does not enable this error code by default. Use --enable-error-code explicit-override to enable it.
- Code
explicit-override- Severity
- error
Used when Pylint has been unable to check methods signature compatibility for an unexpected reason. Please report this kind if you don't make sense of it. pylint calls it method-check-failed.
- Code
F0202- Severity
- fatal
- Message
Unable to check methods signature ({} / {})
Unused imports add a performance overhead at runtime, and risk creating import cycles. They also increase the cognitive load of reading the code. Ruff takes this rule from Pyflakes and made it stable in v0.0.18.
- Code
F401- Message
`{}` imported but unused; consider using `importlib.util.find_spec` to test for availability- Message
`{}` imported but unused; consider removing, adding to `__all__`, or using a redundant alias- Message
`{}` imported but unused
Shadowing an import with loop variables makes the code harder to read and reason about, as the identify of the imported binding is no longer clear. It's also often indicative of a mistake, as it's unlikely that the loop variable is intended to be used as the imported binding. Ruff takes this rule from Pyflakes and made it stable in v0.0.44.
- Code
F402- Message
Import `{}` from {} shadowed by loop variable
Wildcard imports (e.g., from module import *) make it hard to determine which symbols are available in the current namespace, and from which module they were imported. They're also discouraged by PEP 8. Ruff takes this rule from Pyflakes and made it stable in v0.0.18.
- Code
F403- Message
`from {} import *` used; unable to detect undefined names
Imports from __future__ must be placed the beginning of the file, before any other statements (apart from docstrings). The use of __future__ imports elsewhere is invalid and will result in a SyntaxError. Ruff takes this rule from Pyflakes and made it stable in v0.0.34.
- Code
F404- Message
`from __future__` imports must occur at the beginning of the file
Wildcard imports (e.g., from module import *) make it hard to determine which symbols are available in the current namespace. If a module contains a wildcard import, and a name in the current namespace has not been explicitly defined or imported, then it's unclear whether the name is undefined or was imported by the wildcard import. Ruff takes this rule from Pyflakes and made it stable in v0.0.44.
- Code
F405- Message
`{}` may be undefined, or defined from star imports
The use of wildcard imports outside of the module namespace (e.g., within functions) can lead to confusion, as the import can shadow local variables. Ruff takes this rule from Pyflakes and made it stable in v0.0.37.
- Code
F406- Message
`from {} import *` only allowed at module level
Importing undefined or unsupported members from the __future__ module is a SyntaxError. Ruff takes this rule from Pyflakes and made it stable in v0.0.34.
- Code
F407- Message
Future feature `{}` is not defined
Conversion specifiers are required for printf-style format strings. These specifiers must contain a % character followed by a conversion type. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F501- Message
`%`-format string has invalid format string: {}
When using named placeholders in printf-style format strings, the values must be a map type (such as a dictionary). Otherwise, the expression will raise a TypeError. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F502- Message
`%`-format string expected mapping but got sequence
When using mapping-type values (such as dict) in printf-style format strings, the keys must be named. Otherwise, the expression will raise a TypeError. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F503- Message
`%`-format string expected sequence but got mapping
Unused named placeholders in printf-style format strings are unnecessary, and likely indicative of a mistake. They should be removed. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F504- Message
`%`-format string has unused named argument(s): {}
Named placeholders that lack a corresponding value in the provided mapping will raise a KeyError. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F505- Message
`%`-format string is missing argument(s) for placeholder(s): {}
Python does not support mixing positional and named placeholders in printf-style format strings. The use of mixed placeholders will raise a TypeError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F506- Message
`%`-format string has mixed positional and named placeholders
When a printf-style format string is provided with too many or too few substitution values, it will raise a TypeError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F507- Message
`%`-format string has {} placeholder(s) but {} substitution(s)
The use of the * specifier with non-tuple values will raise a TypeError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F508- Message
`%`-format string `*` specifier requires sequence
In printf-style format strings, the % character is used to indicate placeholders. If a % character is not followed by a valid format character, it will raise a ValueError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.142.
- Code
F509- Message
`%`-format string has unsupported format character `{}`
Invalid format strings will raise a ValueError. Ruff takes this rule from Pyflakes and made it stable in v0.0.138.
- Code
F521- Message
`.format` call has invalid format string: {}
Unused keyword arguments are redundant, and often indicative of a mistake. They should be removed. Ruff takes this rule from Pyflakes and made it stable in v0.0.139.
- Code
F522- Message
`.format` call has unused named argument(s): {}
Unused positional arguments are redundant, and often indicative of a mistake. They should be removed. Ruff takes this rule from Pyflakes and made it stable in v0.0.139.
- Code
F523- Message
`.format` call has unused arguments at position(s): {}
In str.format calls, omitting arguments for placeholders will raise a KeyError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.139.
- Code
F524- Message
`.format` call is missing argument(s) for placeholder(s): {}
In str.format calls, mixing automatic and manual numbering will raise a ValueError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.139.
- Code
F525- Message
`.format` string mixes automatic and manual numbering
f-strings are a convenient way to format strings, but they are not necessary if there are no placeholder expressions to format. In this case, a regular string should be used instead, as an f-string without placeholders can be confusing for readers, who may expect such a placeholder to be present. Ruff takes this rule from Pyflakes and made it stable in v0.0.18.
- Code
F541- Message
f-string without any placeholders
Dictionary keys should be unique. If a key is associated with multiple values, the earlier values will be overwritten. Including multiple values for the same key in a dictionary literal is likely a mistake. Ruff takes this rule from Pyflakes and made it stable in v0.0.30.
- Code
F601- Message
Dictionary key literal `{}` repeated- Message
Dictionary key literal `{}` repeated- Message
Dictionary key literal `{}` repeated (`{}` hashes to the same value as `{}`)- Message
Dictionary key literal repeated
Dictionary keys should be unique. If a key is repeated with a different value, the first values will be overwritten and the key will correspond to the last value. This is likely a mistake. Ruff takes this rule from Pyflakes and made it stable in v0.0.30.
- Code
F602- Message
Dictionary key `{}` repeated- Message
Dictionary key repeated
In assignment statements, starred expressions can be used to unpack iterables. Ruff takes this rule from Pyflakes and made it stable in v0.0.32.
- Code
F621- Message
Too many expressions in star-unpacking assignment
In assignment statements, starred expressions can be used to unpack iterables. Including more than one starred expression on the left-hand-side of an assignment will cause a SyntaxError, as it is unclear which expression should receive the remaining values. Ruff takes this rule from Pyflakes and made it stable in v0.0.32.
- Code
F622- Message
Two starred expressions in assignment
Non-empty tuples are always True, so an assert statement with a non-empty tuple as its test condition will always pass. This is likely a mistake. Ruff takes this rule from Pyflakes and made it stable in v0.0.28.
- Code
F631- Message
Assert test is a non-empty tuple, which is always `True`
The is and is not comparators operate on identity, in that they check whether two objects are the same object. If the objects are not the same object, the comparison will always be False. Using is and is not with constant literals often works "by accident", but are not guaranteed to produce the expected result. Ruff takes this rule from Pyflakes and made it stable in v0.0.39.
- Code
F632- Message
Use `==` to compare constant literals- Message
Use `!=` to compare constant literals
In Python 2, the print statement can be used with the >> syntax to print to a file-like object. This print >> sys.stderr syntax no longer exists in Python 3, where print is only a function, not a statement. Ruff takes this rule from Pyflakes and made it stable in v0.0.39.
- Code
F633- Message
Use of `>>` is invalid with `print` function
Non-empty tuples are always True, so an if statement with a non-empty tuple as its test condition will always pass. This is likely a mistake. Ruff takes this rule from Pyflakes and made it stable in v0.0.18.
- Code
F634- Message
If test is a tuple, which is always `True`
The use of a break statement outside of a for or while loop will raise a SyntaxError. Ruff takes this rule from Pyflakes and made it stable in v0.0.36.
- Code
F701- Message
`break` outside loop
The use of a continue statement outside of a for or while loop will raise a SyntaxError. Ruff takes this rule from Pyflakes and made it stable in v0.0.36.
- Code
F702- Message
`continue` not properly in loop
The use of yield, yield from, or await outside of a function will raise a SyntaxError. Ruff takes this rule from Pyflakes and made it stable in v0.0.22.
- Code
F704- Message
`{}` statement outside of a function
The use of a return statement outside of a function will raise a SyntaxError. Ruff takes this rule from Pyflakes and made it stable in v0.0.18.
- Code
F706- Message
`return` statement outside of a function/method
When an exception is raised within a try block, the except blocks are evaluated in order, and the first matching block is executed. If an except block handles all exceptions, but isn't the last block, Python will raise a SyntaxError, as the following blocks would never be executed. Ruff takes this rule from Pyflakes and made it stable in v0.0.28.
- Code
F707- Message
An `except` block as not the last exception handler
In Python, type annotations can be quoted as strings literals to enable references to types that have not yet been defined, known as "forward references". Ruff takes this rule from Pyflakes and made it stable in v0.0.39.
- Code
F722- Message
Syntax error in forward annotation: {}
Redefinitions of unused names are unnecessary and often indicative of a mistake. Ruff takes this rule from Pyflakes and made it stable in v0.0.171.
- Code
F811- Message
Redefinition of unused `{}` from {}
An undefined name is likely to raise NameError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.20.
- Code
F821- Message
Undefined name `{}`. {}- Message
Undefined name `{}`
In Python, the __all__ variable is used to define the names that are exported when a module is imported as a wildcard (e.g., from foo import *). The names in __all__ must be defined in the module, but are included as strings. Ruff takes this rule from Pyflakes and made it stable in v0.0.25.
- Code
F822- Message
Undefined name `{}` in `__all__`
Referencing a local variable before it has been assigned will raise an UnboundLocalError at runtime. Ruff takes this rule from Pyflakes and made it stable in v0.0.24.
- Code
F823- Message
Local variable `{}` referenced before assignment
A variable that is defined but not used is likely a mistake, and should be removed to avoid confusion. Ruff takes this rule from Pyflakes and made it stable in v0.0.22.
- Code
F841- Message
Local variable `{}` is assigned to but never used
Annotations are used to provide type hints to static type checkers. If a variable is annotated but never used, the annotation is unnecessary. Ruff takes this rule from Pyflakes and made it stable in v0.0.172.
- Code
F842- Message
Local variable `{}` is annotated but never used
NotImplemented is a special value returned by binary special methods to indicate that an operation is not implemented with respect to a particular type. Ruff takes this rule from Pyflakes and made it stable in v0.0.18.
- Code
F901- Message
`raise NotImplemented` should be `raise NotImplementedError`
PEP 585 enabled the use of a number of convenient type annotations, such as liststr instead of Liststr. However, these annotations are only available on Python 3.9 and higher, _unless_ the from __future__ import annotations import is present. Ruff takes this rule from flake8-future-annotations and made it stable in v0.0.269.
- Code
FA100- Message
Add `from __future__ import annotations` to simplify `{}`
Using PEP 585 and PEP 604 style annotations without a from __future__ import annotations import will cause runtime errors on Python versions prior to 3.9 and 3.10, respectively. Ruff takes this rule from flake8-future-annotations and made it stable in v0.0.271.
- Code
FA102- Message
Missing `from __future__ import annotations`, but uses {}
FastAPI routes automatically infer the response model type from the return type, so specifying it explicitly is redundant. Ruff takes this rule from FastAPI and made it stable in 0.8.0.
- Code
FAST001- Message
FastAPI route with redundant `response_model` argument
The FastAPI documentation recommends the use of typing.Annotated for defining route dependencies and parameters, rather than using Depends, Query or similar as a default value for a parameter. Using this approach everywhere helps ensure consistency and clarity in defining dependencies and parameters. Ruff takes this rule from FastAPI and made it stable in 0.8.0.
- Code
FAST002- Message
FastAPI dependency without `Annotated`
Path parameters are used to extract values from the URL path. Ruff takes this rule from FastAPI and made it stable in 0.10.0.
- Code
FAST003- Message
Parameter `{}` appears in route path, but not in `{}` signature- Message
Parameter `{}` appears in route path, but only as a positional-only argument in `{}` signature
bool, bool | int, typing.Optionalbool, etc. Calling a function with boolean positional arguments is confusing as the meaning of the boolean value is not clear to the caller and to future readers of the code. Ruff takes this rule from flake8-boolean-trap and made it stable in v0.0.127.
- Code
FBT001- Message
Boolean-typed positional argument in function definition
Calling a function with boolean positional arguments is confusing as the meaning of the boolean value is not clear to the caller and to future readers of the code. Ruff takes this rule from flake8-boolean-trap and made it stable in v0.0.127.
- Code
FBT002- Message
Boolean default positional argument in function definition
Calling a function with boolean positional arguments is confusing as the meaning of the boolean value is not clear to the caller, and to future readers of the code. Ruff takes this rule from flake8-boolean-trap and made it stable in v0.0.127.
- Code
FBT003- Message
Boolean positional value in function call
"FIXME" comments are used to describe an issue that should be resolved (usually, a bug or unexpected behavior). Ruff takes this rule from flake8-fixme and made it stable in v0.0.272.
- Code
FIX001- Message
Line contains FIXME, consider resolving the issue
"TODO" comments are used to describe an issue that should be resolved (usually, a missing feature, optimization, or refactoring opportunity). Ruff takes this rule from flake8-fixme and made it stable in v0.0.272.
- Code
FIX002- Message
Line contains TODO, consider resolving the issue
"XXX" comments are used to describe an issue that should be resolved. Ruff takes this rule from flake8-fixme and made it stable in v0.0.272.
- Code
FIX003- Message
Line contains XXX, consider resolving the issue
"HACK" comments are used to describe an issue that should be resolved (usually, a suboptimal solution or temporary workaround). Ruff takes this rule from flake8-fixme and made it stable in v0.0.272.
- Code
FIX004- Message
Line contains HACK, consider resolving the issue
f-strings are more readable and generally preferred over str.join calls. Ruff takes this rule from flynt and made it stable in v0.0.266.
- Code
FLY002- Message
Consider `{}` instead of string join- Message
Consider f-string instead of string join
Mypy reports an error if you call a function with a None return type and don't ignore the return value, as this is usually (but not always) a programming error. mypy enables this error code by default.
- Code
func-returns-value- Severity
- error
When reading the entire contents of a file into a variable, it's simpler and more concise to use pathlib methods like Path.read_text and Path.read_bytes instead of open and read calls via with statements. Ruff takes this rule from refurb. It is in preview.
- Code
FURB101- Message
`Path.open()` followed by `read()` can be replaced by `{}.{}`- Message
`open` and `read` should be replaced by `Path({}).{}`
When writing a single string to a file, it's simpler and more concise to use pathlib methods like Path.write_text and Path.write_bytes instead of open and write calls via with statements. Ruff takes this rule from refurb. It is in preview.
- Code
FURB103- Message
`Path.open()` followed by `write()` can be replaced by `{}.{}`- Message
`open` and `write` should be replaced by `Path({}).{}`
Prefer calling print without any positional arguments, which is equivalent and more concise. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB105- Message
Unnecessary empty string passed to `print`- Message
Unnecessary separator passed to `print`- Message
Unnecessary empty string and separator passed to `print`
Ternary if expressions are more verbose than or expressions while providing the same functionality. Ruff takes this rule from refurb and made it stable in 0.15.0.
- Code
FURB110- Message
Replace ternary `if` expression with `or` operator
Consecutive calls to append can be less efficient than batching them into a single extend. Each append resizes the list individually, whereas an extend can resize the list once for all elements. Ruff takes this rule from refurb. It is in preview.
- Code
FURB113- Message
Use `{}` instead of repeatedly calling `{}.append()`
When converting an integer to a baseless binary, hexadecimal, or octal string, using f-strings is more concise and readable than using the bin, hex, or oct functions followed by a slice. Ruff takes this rule from refurb and made it stable in 0.13.0.
- Code
FURB116- Message
Replace `{}` call with `{}`- Message
Replace `{}` call with f-string
The operator module provides functions that implement the same functionality as the corresponding operators. For example, operator.add is often equivalent to lambda x, y: x + y. Using the functions from the operator module is more concise and communicates the intent of the code more clearly. Ruff takes this rule from refurb. It is in preview.
- Code
FURB118- Message
Use `operator.{}` instead of defining a {}
When writing a batch of elements, it's more idiomatic to use a single method call to IOBase.writelines, rather than write elements one by one. Ruff takes this rule from refurb and made it stable in 0.12.0.
- Code
FURB122- Message
Use of `{}.write` in a for loop
Rather than iterating over all lines in a file by calling readlines(), it's more convenient and performant to iterate over the file object directly. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB129- Message
Instead of calling `readlines()`, iterate over file object directly
It is faster and more succinct to remove all items via the clear() method. Ruff takes this rule from refurb. It is in preview.
- Code
FURB131- Message
Prefer `clear` over deleting a full slice
If an element should be removed from a set if it is present, it is more succinct and idiomatic to use discard. Ruff takes this rule from refurb and made it stable in 0.12.0.
- Code
FURB132- Message
Use `{}` instead of check and `remove`
An if expression that selects the lesser or greater of two sub-expressions can be replaced with a min() or max() call respectively. When possible, prefer min() and max(), as they're more concise and readable than the equivalent if expression. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB136- Message
Replace `if` expression with `{}` call- Message
Replace `if` expression with `{}`- Message
Replace `{}` with `{}`
When unpacking values from iterators to pass them directly to a function, prefer itertools.starmap. Ruff takes this rule from refurb. It is in preview.
- Code
FURB140- Message
Use `itertools.starmap` instead of the generator
When adding or removing a batch of elements to or from a set, it's more idiomatic to use a single method call rather than adding or removing elements one by one. Ruff takes this rule from refurb. It is in preview.
- Code
FURB142- Message
Use of `set.{}()` in a for loop
The list.copy method is more readable and consistent with copying other types. Ruff takes this rule from refurb. It is in preview.
- Code
FURB145- Message
Prefer `copy` method over slicing
The built-in enumerate function is useful when you need both the index and value of a sequence. Ruff takes this rule from refurb. It is in preview.
- Code
FURB148- Message
`enumerate` value is unused, use `for x in range(len(y))` instead- Message
`enumerate` index is unused, use `for x in y` instead
Hard-coding mathematical constants like π increases code duplication, reduces readability, and may lead to a lack of precision. Ruff takes this rule from refurb. It is in preview.
- Code
FURB152- Message
Replace `{}` with `math.{}`
The global and nonlocal keywords accepts multiple comma-separated names. Instead of using multiple global (or nonlocal) statements for separate variables, you can use a single statement to declare multiple variables at once. Ruff takes this rule from refurb. It is in preview.
- Code
FURB154- Message
Use of repeated consecutive `{}`
Usage of named charsets from the standard library is more readable and less error-prone. Ruff takes this rule from refurb. It is in preview.
- Code
FURB156- Message
Use of hardcoded string charset
The Decimal constructor accepts a variety of arguments, including integers, floats, and strings. However, it's not necessary to cast integer literals to strings when passing them to the Decimal. Ruff takes this rule from refurb and made it stable in 0.12.0.
- Code
FURB157- Message
Verbose expression in `Decimal` constructor
In Python 3.10, a bit_count() method was added to the int class, which is more concise and efficient than converting to a binary representation via bin(...). Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB161- Message
Use of `bin({}).count('1')`
On Python 3.11 and later, datetime.fromisoformat() can handle most ISO 8601 formats including ones affixed with Z, so such an operation is unnecessary. Ruff takes this rule from refurb and made it stable in 0.12.0.
- Code
FURB162- Message
Unnecessary timezone replacement with zero offset
The default base of math.log is e, so specifying it explicitly is redundant. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB163- Message
Prefer `math.{}({})` over `math.log` with a redundant base
Since Python 3.2, the Fraction and Decimal classes can be constructed by passing float or decimal instances to the constructor directly. As such, the use of from_float and from_decimal methods is unnecessary, and should be avoided in favor of the more concise constructor syntax. Ruff takes this rule from refurb and made it stable in 0.16.0.
- Code
FURB164- Message
Verbose method `{}` in `{}` construction
Given an integer string with a prefix (e.g., 0xABC), Python can automatically determine the base of the integer by the prefix without needing to specify it explicitly. Ruff takes this rule from refurb and made it stable in 0.12.0.
- Code
FURB166- Message
Use of `int` with explicit `base={}` after removing prefix
The regular expression module provides descriptive names for each flag, along with single-letter aliases. Prefer the descriptive names, as they are more readable and self-documenting. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB167- Message
Use of regular expression alias `re.{}`
There is only ever one instance of None, so it is more efficient and readable to use the is operator to check if an object is None. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB168- Message
Prefer `is` operator over `isinstance` to check if an object is `None`
There is only ever one instance of None, so it is more efficient and readable to use the is operator to check if an object is None. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB169- Message
When checking against `None`, use `{}` instead of comparison with `type(None)`
Performing a membership test against a container (like a list or set) with a single item is less readable and less efficient than comparing against the item directly. Ruff takes this rule from refurb and made it stable in 0.15.0.
- Code
FURB171- Message
Membership test against single-item container
When looking up the current directory, prefer Path.cwd() over Path().resolve(), as Path.cwd() is more explicit in its intent. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB177- Message
Prefer `Path.cwd()` over `Path().resolve()` for current-directory lookups
Instead of class C(metaclass=abc.ABCMeta): ..., use class C(ABC): ... to define an abstract base class. Inheriting from the ABC wrapper class is semantically identical to setting metaclass=abc.ABCMeta, but more succinct. Ruff takes this rule from refurb. It is in preview.
- Code
FURB180- Message
Use of `metaclass=abc.ABCMeta` to define abstract base class
When generating a hex digest from a hash, it's preferable to use the .hexdigest() method, rather than calling .digest() and then .hex(), as the former is more concise and readable. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB181- Message
Use of hashlib's `.digest().hex()`
When reversing a list, it's more efficient to use the in-place method .reverse() instead of creating a new list, if the original list is no longer needed. Ruff takes this rule from refurb and made it stable in 0.5.0.
- Code
FURB187- Message
Use of assignment of `reversed` on list `{}`
The methods str.removeprefix() and str.removesuffix(), introduced in Python 3.9, have the same behavior while being more readable and efficient. Ruff takes this rule from refurb and made it stable in 0.9.0.
- Code
FURB188- Message
Prefer `str.removeprefix()` over conditionally replacing with slice.- Message
Prefer `str.removesuffix()` over conditionally replacing with slice.
Built-in types don't consistently use their own dunder methods. For example, dict.__init__ and dict.update() bypass __setitem__, making inheritance unreliable. Ruff takes this rule from refurb. It is in preview.
- Code
FURB189- Message
Subclassing `{}` can be error prone, use `collections.{}` instead
Using sorted() to compute the minimum or maximum value in a sequence is inefficient and less readable than using min() or max() directly. Ruff takes this rule from refurb and made it stable in 0.16.0.
- Code
FURB192- Message
Prefer `min` over `sorted()` to compute the minimum value in a sequence- Message
Prefer `max` over `sorted()` to compute the maximum value in a sequence
The logging module provides a mechanism for passing additional values to be logged using the extra keyword argument. This is more consistent, more efficient, and less error-prone than formatting the string directly. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G001- Message
Logging statement uses `str.format`
The logging module provides a mechanism for passing additional values to be logged using the extra keyword argument. This is more consistent, more efficient, and less error-prone than formatting the string directly. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G002- Message
Logging statement uses `%`
The logging module provides a mechanism for passing additional values to be logged using the extra keyword argument. This is more consistent, more efficient, and less error-prone than formatting the string directly. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G003- Message
Logging statement uses `+`
The logging module provides a mechanism for passing additional values to be logged using the extra keyword argument. This is more consistent, more efficient, and less error-prone than formatting the string directly. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G004- Message
Logging statement uses f-string
logging.warn and logging.Logger.warn are deprecated in favor of logging.warning and logging.Logger.warning, which are functionally equivalent. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G010- Message
Logging statement uses `warn` instead of `warning`
The logging module provides a mechanism for passing additional values to be logged using the extra keyword argument. These values are then passed to the LogRecord constructor. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G101- Message
Logging statement uses an `extra` field that clashes with a `LogRecord` field: `{}`
Calling logging.error with exc_info=True is equivalent to calling logging.exception. Using logging.exception is more concise, more readable, and conveys the intent of the logging statement more clearly. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G201- Message
Logging `.exception(...)` should be used instead of `.error(..., exc_info=True)`
exc_info is True by default for logging.exception, and False by default for logging.error. Ruff takes this rule from flake8-logging-format and made it stable in v0.0.236.
- Code
G202- Message
Logging statement has redundant `exc_info`
Mypy sometimes generates an error when it hasn't inferred any type for a variable being referenced. This can happen for references to variables that are initialized later in the source file, and for references across modules that form an import cycle. mypy enables this error code by default.
- Code
has-type- Severity
- error
Consistency is good. Use a common convention for imports to make your code more readable and idiomatic. Ruff takes this rule from isort and made it stable in v0.0.110.
- Code
I001- Message
Import block is un-sorted or un-formatted
In some projects, certain imports are required to be present in all files. For example, some projects assume that from __future__ import annotations is enabled, and thus require that import to be present in all files. Omitting a "required" import (as specified by the user) can cause errors or unexpected behavior. Ruff takes this rule from isort and made it stable in v0.0.218.
- Code
I002- Message
Missing required import: `{}`
Used when a variable is accessed for non-existent member of C extension. Due to unavailability of source static analysis is impossible, but it may be performed by introspecting living objects in run-time. pylint calls it c-extension-no-member.
- Code
I1101- Severity
- info
- Message
{} {} has no {} member{}, but source is unavailable. Consider adding this module to extension-pkg-allow-list if you want to perform analysis based on run-time introspection of living objects.
Consistency is good. Use a common convention for imports to make your code more readable and idiomatic. Ruff takes this rule from flake8-import-conventions and made it stable in v0.0.166.
- Code
ICN001- Message
`{}` should be imported as `{}`
Consistency is good. Avoid using a non-standard naming convention for imports, and, in particular, choosing import aliases that violate PEP 8. Ruff takes this rule from flake8-import-conventions and made it stable in v0.0.262.
- Code
ICN002- Message
`{}` should not be imported as `{}`
Consistency is good. Use a common convention for imports to make your code more readable and idiomatic. Ruff takes this rule from flake8-import-conventions and made it stable in v0.0.263.
- Code
ICN003- Message
Members of `{}` should not be imported explicitly
Warn when a # type: ignore comment does not specify any error codes. This clarifies the intent of the ignore and ensures that only the expected errors are silenced. mypy does not enable this error code by default. Use --enable-error-code ignore-without-code to enable it.
- Code
ignore-without-code- Severity
- error
Mypy generates an error if it can't resolve an import statement. This is a parent error code of import-not-found and import-untyped. mypy enables this error code by default.
- Code
import- Severity
- error
Mypy generates an error if it can't find the source code or a stub file for an imported module. mypy enables this error code by default.
- Code
import-not-found- Severity
- error
Mypy generates an error if it can find the source code for an imported module, but that module does not provide type annotations (via PEP 561). mypy enables this error code by default.
- Code
import-untyped- Severity
- error
Mypy checks that the indexed value in indexing operation such as x[y] supports indexing, and that the index expression has a valid type. mypy enables this error code by default.
- Code
index- Severity
- error
Python packages are directories that contain a file named __init__.py. The existence of this file indicates that the directory is a Python package, and so it can be imported the same way a module can be imported. Ruff takes this rule from flake8-no-pep420 and made it stable in v0.0.225.
- Code
INP001- Message
File `{}` is part of an implicit namespace package. Add an `__init__.py`.- Message
File `{}` declares a package, but is nested under an implicit namespace package. Add an `__init__.py` to `{}`.
In the gettext API, the gettext function (often aliased to _) returns a translation of its input argument by looking it up in a translation catalog. Ruff takes this rule from flake8-gettext and made it stable in v0.0.260.
- Code
INT001- Message
f-string in plural argument is resolved before function call- Message
f-string is resolved before function call; consider `_("string %s") % arg`
In the gettext API, the gettext function (often aliased to _) returns a translation of its input argument by looking it up in a translation catalog. Ruff takes this rule from flake8-gettext and made it stable in v0.0.260.
- Code
INT002- Message
`format` method in plural argument is resolved before function call- Message
`format` method argument is resolved before function call; consider `_("string %s") % arg`
In the gettext API, the gettext function (often aliased to _) returns a translation of its input argument by looking it up in a translation catalog. Ruff takes this rule from flake8-gettext and made it stable in v0.0.260.
- Code
INT003- Message
printf-style format in plural argument is resolved before function call- Message
printf-style format is resolved before function call; consider `_("string %s") % arg`
While it is valid Python syntax to concatenate multiple string or byte literals implicitly (via whitespace delimiters), it is unnecessary and negatively affects code readability. Ruff takes this rule from flake8-implicit-str-concat and made it stable in v0.0.201.
- Code
ISC001- Message
Implicitly concatenated string literals on one line
For string literals that wrap across multiple lines, PEP 8 recommends the use of implicit string concatenation within parentheses instead of using a backslash for line continuation, as the former is more readable than the latter. Ruff takes this rule from flake8-implicit-str-concat and made it stable in v0.0.201.
- Code
ISC002- Message
Implicitly concatenated string literals over multiple lines
For string literals that wrap across multiple lines, implicit string concatenation within parentheses is preferred over explicit concatenation using the + operator, as the former is more readable. Ruff takes this rule from flake8-implicit-str-concat and made it stable in v0.0.201.
- Code
ISC003- Message
Explicitly concatenated string should be implicitly concatenated
In collection literals, implicit string concatenation is often the result of a missing comma between elements, which can silently merge items together. Ruff takes this rule from flake8-implicit-str-concat and made it stable in 0.16.0.
- Code
ISC004- Message
Unparenthesized implicit string concatenation in collection
When constructing a list using [item, ...], mypy checks that each item is compatible with the list type that is inferred from the surrounding context. mypy enables this error code by default.
- Code
list-item- Severity
- error
There are some places where only a (string) literal value is expected for the purposes of static type checking, for example a TypedDict key, or a __match_args__ item. Providing a str-valued variable in such contexts will result in an error. mypy enables this error code by default.
- Code
literal-required- Severity
- error
The Logger Objects documentation states that: Ruff takes this rule from flake8-logging and made it stable in v0.2.0.
- Code
LOG001- Message
Use `logging.getLogger()` to instantiate loggers
The logging documentation recommends this pattern: Ruff takes this rule from flake8-logging and made it stable in v0.2.0.
- Code
LOG002- Message
Use `__name__` with `logging.getLogger()`
The documentation states: > This function should only be called from an exception handler. Ruff takes this rule from flake8-logging and made it stable in 0.16.0.
- Code
LOG004- Message
`.exception()` call outside exception handlers
The logging.exception() method captures the exception automatically, but accepts an optional exc_info argument to override this behavior. Setting exc_info to False disables the automatic capture of the exception and stack trace. Ruff takes this rule from flake8-logging and made it stable in v0.2.0.
- Code
LOG007- Message
Use of `logging.exception` with falsy `exc_info`
The logging.WARN constant is an undocumented alias for logging.WARNING. Ruff takes this rule from flake8-logging and made it stable in v0.2.0.
- Code
LOG009- Message
Use of undocumented `logging.WARN` constant
Using exc_info=True outside of an exception handler attaches None as the exception information, leading to confusing messages: Ruff takes this rule from flake8-logging and made it stable in 0.12.0.
- Code
LOG014- Message
`exc_info=` outside exception handlers
Using the root logger causes the messages to have no source information, making them less useful for debugging. Ruff takes this rule from flake8-logging and made it stable in 0.10.0.
- Code
LOG015- Message
`{}()` call on root logger
TypeForm literals may contain string annotations. mypy enables this error code by default.
- Code
maybe-unrecognized-str-typeform- Severity
- error
Mypy checks whether the metaclass of a class is valid. The metaclass must be a subclass of type. mypy enables this error code by default.
- Code
metaclass- Severity
- error
In general, assigning to a method on class object or instance (a.k.a. monkey-patching) is ambiguous in terms of types, since Python's static type system cannot express the difference between bound and unbound callable types. mypy enables this error code by default.
- Code
method-assign- Severity
- error
Mypy performs numerous other, less commonly failing checks that don't have specific error codes. These use the misc error code. mypy enables this error code by default.
- Code
misc- Severity
- error
mutable-override will enable the check for unsafe overrides of mutable attributes. For historical reasons, and because this is a relatively common pattern in Python, this check is not enabled by default. mypy does not enable this error code by default. Use --enable-error-code mutable-override to enable it.
- Code
mutable-override- Severity
- error
PEP 8 recommends the use of the CapWords (or CamelCase) convention for class names: Ruff takes this rule from pep8-naming and made it stable in v0.0.77.
- Code
N801- Message
Class name `{}` should use CapWords convention
PEP 8 recommends that function names follow snake_case: Ruff takes this rule from pep8-naming and made it stable in v0.0.77.
- Code
N802- Message
Function name `{}` should be lowercase
PEP 8 recommends that function names should be lower case and separated by underscores (also known as snake_case). Ruff takes this rule from pep8-naming and made it stable in v0.0.77.
- Code
N803- Message
Argument name `{}` should be lowercase
PEP 8 recommends the use of cls as the first argument for all class methods: Ruff takes this rule from pep8-naming and made it stable in v0.0.77.
- Code
N804- Message
First argument of a class method should be named `cls`- Message
First argument of `__new__` method should be named `cls`
PEP 8 recommends the use of self as first argument for all instance methods: Ruff takes this rule from pep8-naming and made it stable in v0.0.77.
- Code
N805- Message
First argument of a method should be named `self`
PEP 8 recommends that all function variables use lowercase names: Ruff takes this rule from pep8-naming and made it stable in v0.0.89.
- Code
N806- Message
Variable `{}` in function should be lowercase
PEP 8 recommends that only documented "dunder" methods are used: Ruff takes this rule from pep8-naming and made it stable in v0.0.82.
- Code
N807- Message
Function name should not start and end with `__`
PEP 8 recommends naming conventions for classes, functions, constants, and more. The use of inconsistent naming styles between import and alias names may lead readers to expect an import to be of another type (e.g., confuse a Python class with a constant). Ruff takes this rule from pep8-naming and made it stable in v0.0.82.
- Code
N811- Message
Constant `{}` imported as non-constant `{}`
PEP 8 recommends naming conventions for classes, functions, constants, and more. The use of inconsistent naming styles between import and alias names may lead readers to expect an import to be of another type (e.g., confuse a Python class with a constant). Ruff takes this rule from pep8-naming and made it stable in v0.0.82.
- Code
N812- Message
Lowercase `{}` imported as non-lowercase `{}`
PEP 8 recommends naming conventions for classes, functions, constants, and more. The use of inconsistent naming styles between import and alias names may lead readers to expect an import to be of another type (e.g., confuse a Python class with a constant). Ruff takes this rule from pep8-naming and made it stable in v0.0.82.
- Code
N813- Message
Camelcase `{}` imported as lowercase `{}`
PEP 8 recommends naming conventions for classes, functions, constants, and more. The use of inconsistent naming styles between import and alias names may lead readers to expect an import to be of another type (e.g., confuse a Python class with a constant). Ruff takes this rule from pep8-naming and made it stable in v0.0.82.
- Code
N814- Message
Camelcase `{}` imported as constant `{}`
PEP 8 recommends that variable names should be lower case and separated by underscores (also known as snake_case). Ruff takes this rule from pep8-naming and made it stable in v0.0.89.
- Code
N815- Message
Variable `{}` in class scope should not be mixedCase
PEP 8 recommends that global variable names should be lower case and separated by underscores (also known as snake_case). Ruff takes this rule from pep8-naming and made it stable in v0.0.89.
- Code
N816- Message
Variable `{}` in global scope should not be mixedCase