Rules
Ruff supports over 900 lint rules, many of which are inspired by popular tools like Flake8, isort, pyupgrade, and others. Regardless of the rule's origin, Ruff re-implements every rule in Rust as a first-party feature.
By default, Ruff enables rules from the F, E, B, UP, and RUF categories,
as well as many more, omitting any stylistic rules that overlap with the use of a formatter, like
ruff format or Black.
If you're just getting started with Ruff, the default rule set is a great place to start: it catches a wide variety of common errors (like unused imports) with zero configuration. See Default Rules for the complete list.
Rule legend
Legend
๐งช The rule is unstable and is in "preview".
โ ๏ธ The rule has been deprecated and will be removed in a future release.
โ The rule has been removed only the documentation is available.
๐ ๏ธ The rule is automatically fixable by the --fix command-line option.
โ
The rule is enabled by default.
All rules not marked as preview, deprecated or removed are stable.
| Code | Rule | Category | Linter | Status |
|---|---|---|---|---|
AIR001 |
airflow-variable-name-task-id-mismatchTask variable name should match the task_id: "{task_id}" |
style | Airflow | Rule has been stable since v0.0.271 |
AIR002 |
airflow-dag-no-schedule-argumentDAG or @dag should have an explicit schedule argument |
suspicious | Airflow | Rule has been stable since 0.13.0 |
AIR003 |
airflow-variable-get-outside-taskVariable.get() outside of a task |
suspicious | Airflow | Rule has been in preview since 0.15.6 |
AIR004 |
airflow-task-branch-as-short-circuit@task.branch can be replaced with @task.short_circuit |
complexity | Airflow | Rule has been in preview since 0.15.12 |
AIR201 |
airflow-xcom-pull-in-template-stringUse the .output attribute on the task object for "{task_id}" instead of xcom_pull in a template string |
complexity | Airflow | Rule has been in preview since 0.15.11Automatic fix available |
AIR202 |
airflow-task-implicit-multiple-outputs@task-decorated function relies on multiple_outputs inference |
style | Airflow | Rule has been in preview since 0.15.14Automatic fix available |
AIR301 |
airflow3-removal{deprecated} is removed in Airflow 3.0 |
pedantic | Airflow | Rule has been stable since 0.13.0Automatic fix available |
AIR302 |
airflow3-moved-to-provider{deprecated} is moved into {provider} provider in Airflow 3.0; |
pedantic | Airflow | Rule has been stable since 0.13.0Automatic fix available |
AIR303 |
airflow3-incompatible-function-signature{function_name} signature is changed in Airflow 3.0 |
pedantic | Airflow | Rule has been stable since 0.16.0 |
AIR304 |
airflow3-dag-dynamic-value{function_name}() produces a value that changes at runtime; using it in a Dag or task argument causes infinite Dag version creation |
correctness | Airflow | Rule has been in preview since 0.15.6 |
AIR311 |
airflow3-suggested-update{deprecated} is removed in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version. |
pedantic | Airflow | Rule has been stable since 0.13.0Automatic fix available |
AIR312 |
airflow3-suggested-to-move-to-provider{deprecated} is deprecated and moved into {provider} provider in Airflow 3.0; It still works in Airflow 3.0 but is expected to be removed in a future version. |
pedantic | Airflow | Rule has been stable since 0.13.0Automatic fix available |
AIR321 |
airflow31-moved{deprecated} is moved in Airflow 3.1 |
pedantic | Airflow | Rule has been in preview since 0.15.1Automatic fix available |
ERA001 |
commented-out-codeFound commented-out code |
pedantic | eradicate | Rule has been stable since v0.0.145 |
FAST001 |
fast-api-redundant-response-modelFastAPI route with redundant response_model argument |
complexity | FastAPI | Rule has been stable since 0.8.0Automatic fix available |
FAST002 |
fast-api-non-annotated-dependencyFastAPI dependency without Annotated |
style | FastAPI | Rule has been stable since 0.8.0Automatic fix available |
FAST003 |
fast-api-unused-path-parameterParameter {arg_name} appears in route path, but not in {function_name} signature |
suspicious | FastAPI | Rule has been stable since 0.10.0Automatic fix available |
YTT101 |
sys-version-slice3sys.version[:3] referenced (python3.10), use sys.version_info |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT102 |
sys-version2sys.version[2] referenced (python3.10), use sys.version_info |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT103 |
sys-version-cmp-str3sys.version compared to string (python3.10), use sys.version_info |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT201 |
sys-version-info0-eq3sys.version_info[0] == 3 referenced (python4), use >= |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT202 |
six-py3six.PY3 referenced (python4), use not six.PY2 |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT203 |
sys-version-info1-cmp-intsys.version_info[1] compared to integer (python4), compare sys.version_info to tuple |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT204 |
sys-version-info-minor-cmp-intsys.version_info.minor compared to integer (python4), compare sys.version_info to tuple |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT301 |
sys-version0sys.version[0] referenced (python10), use sys.version_info |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT302 |
sys-version-cmp-str10sys.version compared to string (python10), use sys.version_info |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
YTT303 |
sys-version-slice1sys.version[:1] referenced (python10), use sys.version_info |
suspicious | flake8-2020 | Rule has been stable since v0.0.113Enabled by default |
ANN001 |
missing-type-function-argumentMissing type annotation for function argument {name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105 |
ANN002 |
missing-type-argsMissing type annotation for *{name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105 |
ANN003 |
missing-type-kwargsMissing type annotation for **{name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105 |
ANN101 |
missing-type-selfMissing type annotation for {name} in method |
pedantic | flake8-annotations | Rule was removed in 0.8.0 |
ANN102 |
missing-type-clsMissing type annotation for {name} in classmethod |
pedantic | flake8-annotations | Rule was removed in 0.8.0 |
ANN201 |
missing-return-type-undocumented-public-functionMissing return type annotation for public function {name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105Automatic fix available |
ANN202 |
missing-return-type-private-functionMissing return type annotation for private function {name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105Automatic fix available |
ANN204 |
missing-return-type-special-methodMissing return type annotation for special method {name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105Automatic fix available |
ANN205 |
missing-return-type-static-methodMissing return type annotation for staticmethod {name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105Automatic fix available |
ANN206 |
missing-return-type-class-methodMissing return type annotation for classmethod {name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.105Automatic fix available |
ANN401 |
any-typeDynamically typed expressions (typing.Any) are disallowed in {name} |
pedantic | flake8-annotations | Rule has been stable since v0.0.108 |
ASYNC100 |
cancel-scope-no-checkpointA with {method_name}(...): context does not contain any await statements. This makes it pointless, as the timeout can only be triggered by a checkpoint. |
suspicious | flake8-async | Rule has been stable since v0.0.269Enabled by default |
ASYNC105 |
trio-sync-callCall to {method_name} is not immediately awaited |
suspicious | flake8-async | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
ASYNC109 |
async-function-with-timeoutAsync function definition with a timeout parameter |
pedantic | flake8-async | Rule has been stable since 0.5.0 |
ASYNC110 |
async-busy-waitUse {module}.Event instead of awaiting {module}.sleep in a while loop |
pedantic | flake8-async | Rule has been stable since 0.5.0 |
ASYNC115 |
async-zero-sleepUse {module}.lowlevel.checkpoint() instead of {module}.sleep(0) |
style | flake8-async | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
ASYNC116 |
long-sleep-not-forever{module}.sleep() with >24 hour interval should usually be {module}.sleep_forever() |
style | flake8-async | Rule has been stable since 0.13.0Automatic fix availableEnabled by default |
ASYNC119 |
yield-in-context-manager-in-async-generatorYield in context manager in async generator may not trigger cleanup |
pedantic | flake8-async | Rule has been in preview since 0.15.16 |
ASYNC210 |
blocking-http-call-in-async-functionAsync functions should not call blocking HTTP methods |
suspicious | flake8-async | Rule has been stable since 0.5.0Enabled by default |
ASYNC212 |
blocking-http-call-httpx-in-async-functionBlocking httpx method {name}.{call}() in async context, use httpx.AsyncClient |
suspicious | flake8-async | Rule has been stable since 0.15.0 |
ASYNC220 |
create-subprocess-in-async-functionAsync functions should not create subprocesses with blocking methods |
suspicious | flake8-async | Rule has been stable since 0.5.0Enabled by default |
ASYNC221 |
run-process-in-async-functionAsync functions should not run processes with blocking methods |
suspicious | flake8-async | Rule has been stable since 0.5.0Enabled by default |
ASYNC222 |
wait-for-process-in-async-functionAsync functions should not wait on processes with blocking methods |
suspicious | flake8-async | Rule has been stable since 0.5.0Enabled by default |
ASYNC230 |
blocking-open-call-in-async-functionAsync functions should not open files with blocking methods like open |
suspicious | flake8-async | Rule has been stable since 0.5.0Enabled by default |
ASYNC240 |
blocking-path-method-in-async-functionAsync functions should not perform blocking {path_library} operations |
suspicious | flake8-async | Rule has been stable since 0.15.0 |
ASYNC250 |
blocking-input-in-async-functionBlocking call to input() in async context |
suspicious | flake8-async | Rule has been stable since 0.15.0 |
ASYNC251 |
blocking-sleep-in-async-functionAsync functions should not call time.sleep |
suspicious | flake8-async | Rule has been stable since 0.5.0Enabled by default |
S101 |
assertUse of assert detected |
restriction | flake8-bandit | Rule has been stable since v0.0.116 |
S102 |
exec-builtinUse of exec detected |
security | flake8-bandit | Rule has been stable since v0.0.116Enabled by default |
S103 |
bad-file-permissionsos.chmod setting a permissive mask {mask:#o} on file or directory |
security | flake8-bandit | Rule has been stable since v0.0.211 |
S104 |
hardcoded-bind-all-interfacesPossible binding to all interfaces |
security | flake8-bandit | Rule has been stable since v0.0.116 |
S105 |
hardcoded-password-stringPossible hardcoded password assigned to: "{}" |
security | flake8-bandit | Rule has been stable since v0.0.116 |
S106 |
hardcoded-password-func-argPossible hardcoded password assigned to argument: "{}" |
security | flake8-bandit | Rule has been stable since v0.0.116 |
S107 |
hardcoded-password-defaultPossible hardcoded password assigned to function default: "{}" |
security | flake8-bandit | Rule has been stable since v0.0.116 |
S108 |
hardcoded-temp-fileProbable insecure usage of temporary file or directory: "{}" |
security | flake8-bandit | Rule has been stable since v0.0.211 |
S110 |
try-except-passtry-except-pass detected, consider logging the exception |
suspicious | flake8-bandit | Rule has been stable since v0.0.237Enabled by default |
S112 |
try-except-continuetry-except-continue detected, consider logging the exception |
suspicious | flake8-bandit | Rule has been stable since v0.0.245Enabled by default |
S113 |
request-without-timeoutProbable use of {module} call without timeout |
security | flake8-bandit | Rule has been stable since v0.0.213 |
S201 |
flask-debug-trueUse of debug=True in Flask app detected |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S202 |
tarfile-unsafe-membersUses of tarfile.extractall() |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S301 |
suspicious-pickle-usagepickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S302 |
suspicious-marshal-usageDeserialization with the marshal module is possibly dangerous |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S303 |
suspicious-insecure-hash-usageUse of insecure MD2, MD4, MD5, or SHA1 hash function |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S304 |
suspicious-insecure-cipher-usageUse of insecure cipher, replace with a known secure cipher such as AES |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S305 |
suspicious-insecure-cipher-mode-usageUse of insecure block cipher mode, replace with a known secure mode such as CBC or CTR |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S306 |
suspicious-mktemp-usageUse of insecure and deprecated function ( mktemp) |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S307 |
suspicious-eval-usageUse of possibly insecure function; consider using ast.literal_eval |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S308 |
suspicious-mark-safe-usageUse of mark_safe may expose cross-site scripting vulnerabilities |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S310 |
suspicious-url-open-usageAudit URL open for permitted schemes. Allowing use of file: or custom schemes is often unexpected. |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S311 |
suspicious-non-cryptographic-random-usageStandard pseudo-random generators are not suitable for cryptographic purposes |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S312 |
suspicious-telnet-usageTelnet is considered insecure. Use SSH or some other encrypted protocol. |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S313 |
suspicious-xmlc-element-tree-usageUsing xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S314 |
suspicious-xml-element-tree-usageUsing xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S315 |
suspicious-xml-expat-reader-usageUsing xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S316 |
suspicious-xml-expat-builder-usageUsing xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S317 |
suspicious-xml-sax-usageUsing xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S318 |
suspicious-xml-mini-dom-usageUsing xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S319 |
suspicious-xml-pull-dom-usageUsing xml to parse untrusted data is known to be vulnerable to XML attacks; use defusedxml equivalents |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S320 |
suspicious-xmle-tree-usageUsing lxml to parse untrusted data is known to be vulnerable to XML attacks |
security | flake8-bandit | Rule was removed in 0.12.0 |
S321 |
suspicious-ftp-lib-usageFTP-related functions are being called. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol. |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S323 |
suspicious-unverified-context-usagePython allows using an insecure context via the _create_unverified_context that reverts to the previous behavior that does not validate certificates or perform hostname checks. |
security | flake8-bandit | Rule has been stable since v0.0.258 |
S324 |
hashlib-insecure-hash-functionProbable use of insecure hash functions in {library}: {string} |
security | flake8-bandit | Rule has been stable since v0.0.212 |
S401 |
suspicious-telnetlib-importtelnetlib and related modules are considered insecure. Use SSH or another encrypted protocol. |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S402 |
suspicious-ftplib-importftplib and related modules are considered insecure. Use SSH, SFTP, SCP, or another encrypted protocol. |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S403 |
suspicious-pickle-importpickle, cPickle, dill, and shelve modules are possibly insecure |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S404 |
suspicious-subprocess-importsubprocess module is possibly insecure |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S405 |
suspicious-xml-etree-importxml.etree methods are vulnerable to XML attacks |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S406 |
suspicious-xml-sax-importxml.sax methods are vulnerable to XML attacks |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S407 |
suspicious-xml-expat-importxml.dom.expatbuilder is vulnerable to XML attacks |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S408 |
suspicious-xml-minidom-importxml.dom.minidom is vulnerable to XML attacks |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S409 |
suspicious-xml-pulldom-importxml.dom.pulldom is vulnerable to XML attacks |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S410 |
suspicious-lxml-importlxml is vulnerable to XML attacks |
security | flake8-bandit | Rule was removed in v0.3.0 |
S411 |
suspicious-xmlrpc-importXMLRPC is vulnerable to remote XML attacks |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S412 |
suspicious-httpoxy-importhttpoxy is a set of vulnerabilities that affect application code running inCGI, or CGI-like environments. The use of CGI for web applications should be avoided |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S413 |
suspicious-pycrypto-importpycrypto library is known to have publicly disclosed buffer overflow vulnerability |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S415 |
suspicious-pyghmi-importAn IPMI-related module is being imported. Prefer an encrypted protocol over IPMI. |
security | flake8-bandit | Rule has been in preview since v0.1.12 |
S501 |
request-with-no-cert-validationProbable use of {string} call with verify=False disabling SSL certificate checks |
security | flake8-bandit | Rule has been stable since v0.0.213 |
S502 |
ssl-insecure-versionCall made with insecure SSL protocol: {protocol} |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S503 |
ssl-with-bad-defaultsArgument default set to insecure SSL protocol: {protocol} |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S504 |
ssl-with-no-versionssl.wrap_socket called without an `ssl_version`` |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S505 |
weak-cryptographic-key{cryptographic_key} key sizes below {minimum_key_size} bits are considered breakable |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S506 |
unsafe-yaml-loadProbable use of unsafe loader {name} with yaml.load. Allows instantiation of arbitrary objects. Consider yaml.safe_load. |
security | flake8-bandit | Rule has been stable since v0.0.212 |
S507 |
ssh-no-host-key-verificationParamiko call with policy set to automatically trust the unknown host key |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S508 |
snmp-insecure-versionThe use of SNMPv1 and SNMPv2 is insecure. Use SNMPv3 if able. |
security | flake8-bandit | Rule has been stable since v0.0.218 |
S509 |
snmp-weak-cryptographyYou should not use SNMPv3 without encryption. noAuthNoPriv & authNoPriv is insecure. |
security | flake8-bandit | Rule has been stable since v0.0.218 |
S601 |
paramiko-callPossible shell injection via Paramiko call; check inputs are properly sanitized |
security | flake8-bandit | Rule has been stable since v0.0.270 |
S602 |
subprocess-popen-with-shell-equals-truesubprocess call with shell=True seems safe, but may be changed in the future; consider rewriting without shell |
security | flake8-bandit | Rule has been stable since v0.0.262 |
S603 |
subprocess-without-shell-equals-truesubprocess call: check for execution of untrusted input |
security | flake8-bandit | Rule has been stable since v0.0.262 |
S604 |
call-with-shell-equals-trueFunction call with shell=True parameter identified, security issue |
security | flake8-bandit | Rule has been stable since v0.0.262 |
S605 |
start-process-with-a-shellStarting a process with a shell: seems safe, but may be changed in the future; consider rewriting without shell |
security | flake8-bandit | Rule has been stable since v0.0.262 |
S606 |
start-process-with-no-shellStarting a process without a shell |
security | flake8-bandit | Rule has been stable since v0.0.262 |
S607 |
start-process-with-partial-pathStarting a process with a partial executable path |
security | flake8-bandit | Rule has been stable since v0.0.262 |
S608 |
hardcoded-sql-expressionPossible SQL injection vector through string-based query construction |
security | flake8-bandit | Rule has been stable since v0.0.245 |
S609 |
unix-command-wildcard-injectionPossible wildcard injection in call due to * usage |
security | flake8-bandit | Rule has been stable since v0.0.271 |
S610 |
django-extraUse of Django extra can lead to SQL injection vulnerabilities |
security | flake8-bandit | Rule has been stable since 0.5.0 |
S611 |
django-raw-sqlUse of RawSQL can lead to SQL injection vulnerabilities |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S612 |
logging-config-insecure-listenUse of insecure logging.config.listen detected |
security | flake8-bandit | Rule has been stable since v0.0.231 |
S701 |
jinja2-autoescape-falseUsing jinja2 templates with autoescape=False is dangerous and can lead to XSS. Ensure autoescape=True or use the select_autoescape function. |
security | flake8-bandit | Rule has been stable since v0.0.220 |
S702 |
mako-templatesMako templates allow HTML and JavaScript rendering by default and are inherently open to XSS attacks |
security | flake8-bandit | Rule has been stable since v0.2.0 |
S704 |
unsafe-markup-useUnsafe use of {name} detected |
security | flake8-bandit | Rule has been stable since 0.10.0 |
BLE001 |
blind-exceptDo not catch blind exception: {name} |
suspicious | flake8-blind-except | Rule has been stable since v0.0.127Enabled by default |
FBT001 |
boolean-type-hint-positional-argumentBoolean-typed positional argument in function definition |
pedantic | flake8-boolean-trap | Rule has been stable since v0.0.127 |
FBT002 |
boolean-default-value-positional-argumentBoolean default positional argument in function definition |
pedantic | flake8-boolean-trap | Rule has been stable since v0.0.127 |
FBT003 |
boolean-positional-value-in-callBoolean positional value in function call |
pedantic | flake8-boolean-trap | Rule has been stable since v0.0.127 |
B002 |
unary-prefix-increment-decrementPython does not support the unary prefix increment operator ( ++) |
correctness | flake8-bugbear | Rule has been stable since v0.0.83Enabled by default |
B003 |
assignment-to-os-environAssigning to os.environ doesn't clear the environment |
suspicious | flake8-bugbear | Rule has been stable since v0.0.102Enabled by default |
B004 |
unreliable-callable-checkUsing hasattr(x, "__call__") to test if x is callable is unreliable. Use callable(x) for consistent results. |
suspicious | flake8-bugbear | Rule has been stable since v0.0.106Automatic fix availableEnabled by default |
B005 |
strip-with-multi-charactersUsing .strip() with multi-character strings is misleading |
correctness | flake8-bugbear | Rule has been stable since v0.0.106Enabled by default |
B006 |
mutable-argument-defaultDo not use mutable data structures for argument defaults |
suspicious | flake8-bugbear | Rule has been stable since v0.0.92Automatic fix availableEnabled by default |
B007 |
unused-loop-control-variableLoop control variable {name} not used within loop body |
pedantic | flake8-bugbear | Rule has been stable since v0.0.84Automatic fix available |
B008 |
function-call-in-default-argumentDo not perform function call {name} in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable |
suspicious | flake8-bugbear | Rule has been stable since v0.0.102Enabled by default |
B009 |
get-attr-with-constantDo not call getattr with a constant attribute value. It is not any safer than normal property access. |
complexity | flake8-bugbear | Rule has been stable since v0.0.110Automatic fix availableEnabled by default |
B010 |
set-attr-with-constantDo not call setattr with a constant attribute value. It is not any safer than normal property access. |
complexity | flake8-bugbear | Rule has been stable since v0.0.111Automatic fix availableEnabled by default |
B011 |
assert-falseDo not assert False (python -O removes these calls), raise AssertionError() |
pedantic | flake8-bugbear | Rule has been stable since v0.0.67Automatic fix available |
B012 |
jump-statement-in-finally{name} inside finally blocks cause exceptions to be silenced |
suspicious | flake8-bugbear | Rule has been stable since v0.0.116Enabled by default |
B013 |
redundant-tuple-in-exception-handlerA length-one tuple literal is redundant in exception handlers |
complexity | flake8-bugbear | Rule has been stable since v0.0.89Automatic fix availableEnabled by default |
B014 |
duplicate-handler-exceptionException handler with duplicate exception: {name} |
correctness | flake8-bugbear | Rule has been stable since v0.0.67Automatic fix availableEnabled by default |
B015 |
useless-comparisonPointless comparison. Did you mean to assign a value? Otherwise, prepend assert or remove it. |
correctness | flake8-bugbear | Rule has been stable since v0.0.102Enabled by default |
B016 |
raise-literalCannot raise a literal. Did you intend to return it or raise an Exception? |
correctness | flake8-bugbear | Rule has been stable since v0.0.102Enabled by default |
B017 |
assert-raises-exceptionDo not assert blind exception: {exception} |
suspicious | flake8-bugbear | Rule has been stable since v0.0.83Enabled by default |
B018 |
useless-expressionFound useless expression. Either assign it to a variable or remove it. |
suspicious | flake8-bugbear | Rule has been stable since v0.0.100Enabled by default |
B019 |
cached-instance-methodUse of functools.lru_cache or functools.cache on methods can lead to memory leaks |
suspicious | flake8-bugbear | Rule has been stable since v0.0.114Enabled by default |
B020 |
loop-variable-overrides-iteratorLoop control variable {name} overrides iterable it iterates |
suspicious | flake8-bugbear | Rule has been stable since v0.0.121Enabled by default |
B021 |
f-string-docstringf-string used as docstring. Python will interpret this as a joined string, rather than a docstring. |
correctness | flake8-bugbear | Rule has been stable since v0.0.116Enabled by default |
B022 |
useless-contextlib-suppressNo arguments passed to contextlib.suppress. No exceptions will be suppressed and therefore this context manager is redundant |
correctness | flake8-bugbear | Rule has been stable since v0.0.118Enabled by default |
B023 |
function-uses-loop-variableFunction definition does not bind loop variable {name} |
suspicious | flake8-bugbear | Rule has been stable since v0.0.139Enabled by default |
B024 |
abstract-base-class-without-abstract-method{name} is an abstract base class, but it has no abstract methods or properties |
suspicious | flake8-bugbear | Rule has been stable since v0.0.118 |
B025 |
duplicate-try-block-exceptiontry-except* block with duplicate exception {name} |
correctness | flake8-bugbear | Rule has been stable since v0.0.67Enabled by default |
B026 |
star-arg-unpacking-after-keyword-argStar-arg unpacking after a keyword argument is strongly discouraged |
suspicious | flake8-bugbear | Rule has been stable since v0.0.109Enabled by default |
B027 |
empty-method-without-abstract-decorator{name} is an empty method in an abstract base class, but has no abstract decorator |
suspicious | flake8-bugbear | Rule has been stable since v0.0.118 |
B028 |
no-explicit-stacklevelNo explicit stacklevel keyword argument found |
pedantic | flake8-bugbear | Rule has been stable since v0.0.257Automatic fix available |
B029 |
except-with-empty-tupleUsing except* (): with an empty tuple does not catch anything; add exceptions to handle |
correctness | flake8-bugbear | Rule has been stable since v0.0.250Enabled by default |
B030 |
except-with-non-exception-classesexcept* handlers should only be exception classes or tuples of exception classes |
correctness | flake8-bugbear | Rule has been stable since v0.0.255Enabled by default |
B031 |
reuse-of-groupby-generatorUsing the generator returned from itertools.groupby() more than once will do nothing on the second usage |
suspicious | flake8-bugbear | Rule has been stable since v0.0.260Enabled by default |
B032 |
unintentional-type-annotationPossible unintentional type annotation (using :). Did you mean to assign (using =)? |
suspicious | flake8-bugbear | Rule has been stable since v0.0.250Enabled by default |
B033 |
duplicate-valueSets should not contain duplicate item {value} |
correctness | flake8-bugbear | Rule has been stable since v0.0.271Automatic fix availableEnabled by default |
B034 |
re-sub-positional-args{method} should pass {param_name} and flags as keyword arguments to avoid confusion due to unintuitive argument positions |
pedantic | flake8-bugbear | Rule has been stable since v0.0.278 |
B035 |
static-key-dict-comprehensionDictionary comprehension uses static key: {key} |
correctness | flake8-bugbear | Rule has been stable since v0.2.0Enabled by default |
B039 |
mutable-contextvar-defaultDo not use mutable data structures for ContextVar defaults |
suspicious | flake8-bugbear | Rule has been stable since 0.8.0Enabled by default |
B043 |
del-attr-with-constantDo not call delattr with a constant attribute value. It is not any safer than normal property deletion. |
complexity | flake8-bugbear | Rule has been in preview since 0.15.6Automatic fix available |
B901 |
return-in-generatorUsing yield and return {value} in a generator function can lead to confusing behavior |
suspicious | flake8-bugbear | Rule has been in preview since v0.4.8 |
B903 |
class-as-data-structureClass could be dataclass or namedtuple |
pedantic | flake8-bugbear | Rule has been in preview since 0.9.0 |
B904 |
raise-without-from-inside-exceptWithin an except* clause, raise exceptions with raise ... from err or raise ... from None to distinguish them from errors in exception handling |
pedantic | flake8-bugbear | Rule has been stable since v0.0.138 |
B905 |
zip-without-explicit-strictzip() without an explicit strict= parameter |
pedantic | flake8-bugbear | Rule has been stable since v0.0.167Automatic fix available |
B909 |
loop-iterator-mutationMutation to loop iterable {name} during iteration |
suspicious | flake8-bugbear | Rule has been in preview since v0.3.7 |
B911 |
batched-without-explicit-strictitertools.batched() without an explicit strict parameter |
pedantic | flake8-bugbear | Rule has been stable since 0.10.0 |
B912 |
map-without-explicit-strictmap() without an explicit strict= parameter |
pedantic | flake8-bugbear | Rule has been stable since 0.15.0Automatic fix available |
A001 |
builtin-variable-shadowingVariable {name} is shadowing a Python builtin |
pedantic | flake8-builtins | Rule has been stable since v0.0.48 |
A002 |
builtin-argument-shadowingFunction argument {name} is shadowing a Python builtin |
pedantic | flake8-builtins | Rule has been stable since v0.0.48 |
A003 |
builtin-attribute-shadowingPython builtin is shadowed by class attribute {name} from {row} |
pedantic | flake8-builtins | Rule has been stable since v0.0.48 |
A004 |
builtin-import-shadowingImport {name} is shadowing a Python builtin |
pedantic | flake8-builtins | Rule has been stable since 0.8.0 |
A005 |
stdlib-module-shadowingModule {name} shadows a Python standard-library module |
pedantic | flake8-builtins | Rule has been stable since 0.9.0 |
A006 |
builtin-lambda-argument-shadowingLambda argument {name} is shadowing a Python builtin |
pedantic | flake8-builtins | Rule has been stable since 0.9.0 |
COM812 |
missing-trailing-commaTrailing comma missing |
formatting | flake8-commas | Rule has been stable since v0.0.223Automatic fix available |
COM818 |
trailing-comma-on-bare-tupleTrailing comma on bare tuple prohibited |
suspicious | flake8-commas | Rule has been stable since v0.0.223 |
COM819 |
prohibited-trailing-commaTrailing comma prohibited |
formatting | flake8-commas | Rule has been stable since v0.0.223Automatic fix available |
C400 |
unnecessary-generator-listUnnecessary generator (rewrite using list()) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.61Automatic fix availableEnabled by default |
C401 |
unnecessary-generator-setUnnecessary generator (rewrite using set()) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.61Automatic fix availableEnabled by default |
C402 |
unnecessary-generator-dictUnnecessary generator (rewrite as a dict comprehension) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.61Automatic fix availableEnabled by default |
C403 |
unnecessary-list-comprehension-setUnnecessary list comprehension (rewrite as a set comprehension) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.58Automatic fix availableEnabled by default |
C404 |
unnecessary-list-comprehension-dictUnnecessary list comprehension (rewrite as a dict comprehension) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.58Automatic fix availableEnabled by default |
C405 |
unnecessary-literal-setUnnecessary {kind} literal (rewrite as a set literal) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.61Automatic fix availableEnabled by default |
C406 |
unnecessary-literal-dictUnnecessary {obj_type} literal (rewrite as a dict literal) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.61Automatic fix availableEnabled by default |
C408 |
unnecessary-collection-callUnnecessary {kind}() call (rewrite as a literal) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.61Automatic fix availableEnabled by default |
C409 |
unnecessary-literal-within-tuple-callUnnecessary list literal passed to tuple() (rewrite as a tuple literal) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.66Automatic fix availableEnabled by default |
C410 |
unnecessary-literal-within-list-callUnnecessary list literal passed to list() (remove the outer call to list()) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.66Automatic fix availableEnabled by default |
C411 |
unnecessary-list-callUnnecessary list() call (remove the outer call to list()) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.73Automatic fix availableEnabled by default |
C413 |
unnecessary-call-around-sortedUnnecessary {func}() call around sorted() |
complexity | flake8-comprehensions | Rule has been stable since v0.0.73Automatic fix availableEnabled by default |
C414 |
unnecessary-double-cast-or-processUnnecessary {inner}() call within {outer}() |
complexity | flake8-comprehensions | Rule has been stable since v0.0.70Automatic fix availableEnabled by default |
C415 |
unnecessary-subscript-reversalUnnecessary subscript reversal of iterable within {func}() |
complexity | flake8-comprehensions | Rule has been stable since v0.0.64Enabled by default |
C416 |
unnecessary-comprehensionUnnecessary {kind} comprehension (rewrite using {kind}()) |
pedantic | flake8-comprehensions | Rule has been stable since v0.0.73Automatic fix available |
C417 |
unnecessary-mapUnnecessary map() usage (rewrite using a {object_type}) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.74Automatic fix availableEnabled by default |
C418 |
unnecessary-literal-within-dict-callUnnecessary dict {kind} passed to dict() (remove the outer call to dict()) |
complexity | flake8-comprehensions | Rule has been stable since v0.0.262Automatic fix availableEnabled by default |
C419 |
unnecessary-comprehension-in-callUnnecessary list comprehension |
complexity | flake8-comprehensions | Rule has been stable since v0.0.262Automatic fix availableEnabled by default |
C420 |
unnecessary-dict-comprehension-for-iterableUnnecessary dict comprehension for iterable; use dict.fromkeys instead |
complexity | flake8-comprehensions | Rule has been stable since 0.10.0Automatic fix available |
CPY001 |
missing-copyright-noticeMissing copyright notice at top of file |
pedantic | flake8-copyright | Rule has been stable since 0.16.0 |
DTZ001 |
call-datetime-without-tzinfodatetime.datetime() called without a tzinfo argument |
pedantic | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ002 |
call-datetime-todaydatetime.datetime.today() used |
suspicious | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ003 |
call-datetime-utcnowdatetime.datetime.utcnow() used |
suspicious | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ004 |
call-datetime-utcfromtimestampdatetime.datetime.utcfromtimestamp() used |
suspicious | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ005 |
call-datetime-now-without-tzinfodatetime.datetime.now() called without a tz argument |
pedantic | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ006 |
call-datetime-fromtimestampdatetime.datetime.fromtimestamp() called without a tz argument |
pedantic | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ007 |
call-datetime-strptime-without-zoneNaive datetime constructed using datetime.datetime.strptime() without %z |
pedantic | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ011 |
call-date-todaydatetime.date.today() used |
pedantic | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ012 |
call-date-fromtimestampdatetime.date.fromtimestamp() used |
pedantic | flake8-datetimez | Rule has been stable since v0.0.188Enabled by default |
DTZ901 |
datetime-min-maxUse of datetime.datetime.{min_max} without timezone information |
pedantic | flake8-datetimez | Rule has been stable since 0.10.0Enabled by default |
T100 |
debuggerTrace found: {name} used |
correctness | flake8-debugger | Rule has been stable since v0.0.141Enabled by default |
DJ001 |
django-nullable-model-string-fieldAvoid using null=True on string-based fields such as {field_name} |
pedantic | flake8-django | Rule has been stable since v0.0.246 |
DJ003 |
django-locals-in-render-functionAvoid passing locals() as context to a render function |
security | flake8-django | Rule has been stable since v0.0.253 |
DJ006 |
django-exclude-with-model-formDo not use exclude with ModelForm, use fields instead |
security | flake8-django | Rule has been stable since v0.0.253 |
DJ007 |
django-all-with-model-formDo not use __all__ with ModelForm, use fields instead |
security | flake8-django | Rule has been stable since v0.0.253 |
DJ008 |
django-model-without-dunder-strModel does not define __str__ method |
style | flake8-django | Rule has been stable since v0.0.246 |
DJ012 |
django-unordered-body-content-in-modelOrder of model's inner classes, methods, and fields does not follow the Django Style Guide: {element_type} should come before {prev_element_type} |
style | flake8-django | Rule has been stable since v0.0.258 |
DJ013 |
django-non-leading-receiver-decorator@receiver decorator must be on top of all the other decorators |
suspicious | flake8-django | Rule has been stable since v0.0.246 |
EM101 |
raw-string-in-exceptionException must not use a string literal, assign to variable first |
pedantic | flake8-errmsg | Rule has been stable since v0.0.183Automatic fix available |
EM102 |
f-string-in-exceptionException must not use an f-string literal, assign to variable first |
pedantic | flake8-errmsg | Rule has been stable since v0.0.183Automatic fix available |
EM103 |
dot-format-in-exceptionException must not use a .format() string directly, assign to variable first |
pedantic | flake8-errmsg | Rule has been stable since v0.0.183Automatic fix available |
EXE001 |
shebang-not-executableShebang is present but file is not executable |
suspicious | flake8-executable | Rule has been stable since v0.0.233Enabled by default |
EXE002 |
shebang-missing-executable-fileThe file is executable but no shebang is present |
correctness | flake8-executable | Rule has been stable since v0.0.233Enabled by default |
EXE003 |
shebang-missing-pythonShebang should contain python, pytest, or uv run |
pedantic | flake8-executable | Rule has been stable since v0.0.229 |
EXE004 |
shebang-leading-whitespaceAvoid whitespace before shebang |
correctness | flake8-executable | Rule has been stable since v0.0.229Automatic fix availableEnabled by default |
EXE005 |
shebang-not-first-lineShebang should be at the beginning of the file |
suspicious | flake8-executable | Rule has been stable since v0.0.229Enabled by default |
FIX001 |
line-contains-fixmeLine contains FIXME, consider resolving the issue |
pedantic | flake8-fixme | Rule has been stable since v0.0.272 |
FIX002 |
line-contains-todoLine contains TODO, consider resolving the issue |
pedantic | flake8-fixme | Rule has been stable since v0.0.272 |
FIX003 |
line-contains-xxxLine contains XXX, consider resolving the issue |
pedantic | flake8-fixme | Rule has been stable since v0.0.272 |
FIX004 |
line-contains-hackLine contains HACK, consider resolving the issue |
pedantic | flake8-fixme | Rule has been stable since v0.0.272 |
FA100 |
future-rewritable-type-annotationAdd from __future__ import annotations to simplify {name} |
style | flake8-future-annotations | Rule has been stable since v0.0.269Automatic fix availableEnabled by default |
FA102 |
future-required-type-annotationMissing from __future__ import annotations, but uses {reason} |
correctness | flake8-future-annotations | Rule has been stable since v0.0.271Automatic fix availableEnabled by default |
INT001 |
f-string-in-get-text-func-callf-string in plural argument is resolved before function call |
suspicious | flake8-gettext | Rule has been stable since v0.0.260Enabled by default |
INT002 |
format-in-get-text-func-callformat method in plural argument is resolved before function call |
suspicious | flake8-gettext | Rule has been stable since v0.0.260Enabled by default |
INT003 |
printf-in-get-text-func-callprintf-style format in plural argument is resolved before function call |
suspicious | flake8-gettext | Rule has been stable since v0.0.260Enabled by default |
ISC001 |
single-line-implicit-string-concatenationImplicitly concatenated string literals on one line |
restriction | flake8-implicit-str-concat | Rule has been stable since v0.0.201Automatic fix available |
ISC002 |
multi-line-implicit-string-concatenationImplicitly concatenated string literals over multiple lines |
formatting | flake8-implicit-str-concat | Rule has been stable since v0.0.201 |
ISC003 |
explicit-string-concatenationExplicitly concatenated string should be implicitly concatenated |
restriction | flake8-implicit-str-concat | Rule has been stable since v0.0.201Automatic fix available |
ISC004 |
implicit-string-concatenation-in-collection-literalUnparenthesized implicit string concatenation in collection |
suspicious | flake8-implicit-str-concat | Rule has been stable since 0.16.0Automatic fix availableEnabled by default |
ICN001 |
unconventional-import-alias{name} should be imported as {asname} |
pedantic | flake8-import-conventions | Rule has been stable since v0.0.166Automatic fix available |
ICN002 |
banned-import-alias{name} should not be imported as {asname} |
pedantic | flake8-import-conventions | Rule has been stable since v0.0.262 |
ICN003 |
banned-import-fromMembers of {name} should not be imported explicitly |
pedantic | flake8-import-conventions | Rule has been stable since v0.0.263 |
LOG001 |
direct-logger-instantiationUse logging.getLogger() to instantiate loggers |
correctness | flake8-logging | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
LOG002 |
invalid-get-logger-argumentUse __name__ with logging.getLogger() |
suspicious | flake8-logging | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
LOG004 |
log-exception-outside-except-handler.exception() call outside exception handlers |
pedantic | flake8-logging | Rule has been stable since 0.16.0Automatic fix available |
LOG007 |
exception-without-exc-infoUse of logging.exception with falsy exc_info |
pedantic | flake8-logging | Rule has been stable since v0.2.0 |
LOG009 |
undocumented-warnUse of undocumented logging.WARN constant |
suspicious | flake8-logging | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
LOG014 |
exc-info-outside-except-handlerexc_info= outside exception handlers |
suspicious | flake8-logging | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
LOG015 |
root-logger-call{}() call on root logger |
style | flake8-logging | Rule has been stable since 0.10.0Enabled by default |
G001 |
logging-string-formatLogging statement uses str.format |
pedantic | flake8-logging-format | Rule has been stable since v0.0.236 |
G002 |
logging-percent-formatLogging statement uses % |
pedantic | flake8-logging-format | Rule has been stable since v0.0.236 |
G003 |
logging-string-concatLogging statement uses + |
pedantic | flake8-logging-format | Rule has been stable since v0.0.236 |
G004 |
logging-f-stringLogging statement uses f-string |
pedantic | flake8-logging-format | Rule has been stable since v0.0.236Automatic fix available |
G010 |
logging-warnLogging statement uses warn instead of warning |
suspicious | flake8-logging-format | Rule has been stable since v0.0.236Automatic fix availableEnabled by default |
G101 |
logging-extra-attr-clashLogging statement uses an extra field that clashes with a LogRecord field: {key} |
correctness | flake8-logging-format | Rule has been stable since v0.0.236Enabled by default |
G201 |
logging-exc-infoLogging .exception(...) should be used instead of .error(..., exc_info=True) |
complexity | flake8-logging-format | Rule has been stable since v0.0.236Enabled by default |
G202 |
logging-redundant-exc-infoLogging statement has redundant exc_info |
style | flake8-logging-format | Rule has been stable since v0.0.236Enabled by default |
INP001 |
implicit-namespace-packageFile {filename} is part of an implicit namespace package. Add an __init__.py. |
pedantic | flake8-no-pep420 | Rule has been stable since v0.0.225 |
PIE790 |
unnecessary-placeholderUnnecessary pass statement |
style | flake8-pie | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
PIE794 |
duplicate-class-field-definitionClass field {name} is defined multiple times |
correctness | flake8-pie | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
PIE796 |
non-unique-enumsEnum contains duplicate value: {value} |
suspicious | flake8-pie | Rule has been stable since v0.0.224Enabled by default |
PIE800 |
unnecessary-spreadUnnecessary spread ** |
complexity | flake8-pie | Rule has been stable since v0.0.231Automatic fix availableEnabled by default |
PIE804 |
unnecessary-dict-kwargsUnnecessary dict kwargs |
style | flake8-pie | Rule has been stable since v0.0.231Automatic fix availableEnabled by default |
PIE807 |
reimplemented-container-builtinPrefer {container} over useless lambda |
complexity | flake8-pie | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
PIE808 |
unnecessary-range-startUnnecessary start argument in range |
complexity | flake8-pie | Rule has been stable since v0.0.286Automatic fix availableEnabled by default |
PIE810 |
multiple-starts-ends-withCall {attr} once with a tuple |
complexity | flake8-pie | Rule has been stable since v0.0.243Automatic fix availableEnabled by default |
T201 |
printprint found |
restriction | flake8-print | Rule has been stable since v0.0.57Automatic fix available |
T203 |
p-printpprint found |
restriction | flake8-print | Rule has been stable since v0.0.57Automatic fix available |
PYI001 |
unprefixed-type-paramName of private {kind} must start with _ |
style | flake8-pyi | Rule has been stable since v0.0.245Enabled by default |
PYI002 |
complex-if-statement-in-stubif test in a stub file must be a simple comparison against sys.platform or sys.version_info |
suspicious | flake8-pyi | Rule has been stable since v0.0.276Enabled by default |
PYI003 |
unrecognized-version-info-checkUnrecognized sys.version_info check |
suspicious | flake8-pyi | Rule has been stable since v0.0.276Enabled by default |
PYI004 |
patch-version-comparisonVersion comparison must use only major and minor version |
suspicious | flake8-pyi | Rule has been stable since v0.0.276Enabled by default |
PYI005 |
wrong-tuple-length-version-comparisonVersion comparison must be against a length-{expected_length} tuple |
suspicious | flake8-pyi | Rule has been stable since v0.0.276Enabled by default |
PYI006 |
bad-version-info-comparisonUse < or >= for sys.version_info comparisons |
suspicious | flake8-pyi | Rule has been stable since v0.0.254Enabled by default |
PYI007 |
unrecognized-platform-checkUnrecognized sys.platform check |
suspicious | flake8-pyi | Rule has been stable since v0.0.246Enabled by default |
PYI008 |
unrecognized-platform-nameUnrecognized platform {platform} |
suspicious | flake8-pyi | Rule has been stable since v0.0.246Enabled by default |
PYI009 |
pass-statement-stub-bodyEmpty body should contain ..., not pass |
style | flake8-pyi | Rule has been stable since v0.0.253Automatic fix availableEnabled by default |
PYI010 |
non-empty-stub-bodyFunction body must contain only ... |
correctness | flake8-pyi | Rule has been stable since v0.0.253Automatic fix availableEnabled by default |
PYI011 |
typed-argument-default-in-stubOnly simple default values allowed for typed arguments |
pedantic | flake8-pyi | Rule has been stable since v0.0.253Automatic fix available |
PYI012 |
pass-in-class-bodyClass body must not contain pass |
correctness | flake8-pyi | Rule has been stable since v0.0.260Automatic fix availableEnabled by default |
PYI013 |
ellipsis-in-non-empty-class-bodyNon-empty class body must not contain ... |
correctness | flake8-pyi | Rule has been stable since v0.0.270Automatic fix availableEnabled by default |
PYI014 |
argument-default-in-stubOnly simple default values allowed for arguments |
pedantic | flake8-pyi | Rule has been stable since v0.0.253Automatic fix available |
PYI015 |
assignment-default-in-stubOnly simple default values allowed for assignments |
style | flake8-pyi | Rule has been stable since v0.0.260Automatic fix availableEnabled by default |
PYI016 |
duplicate-union-memberDuplicate union member {} |
correctness | flake8-pyi | Rule has been stable since v0.0.262Automatic fix availableEnabled by default |
PYI017 |
complex-assignment-in-stubStubs should not contain assignments to attributes or multiple targets |
suspicious | flake8-pyi | Rule has been stable since v0.0.279Enabled by default |
PYI018 |
unused-private-type-varPrivate {type_var_like_kind} {type_var_like_name} is never used |
suspicious | flake8-pyi | Rule has been stable since v0.0.281Automatic fix availableEnabled by default |
PYI019 |
custom-type-var-for-selfUse Self instead of custom TypeVar {} |
complexity | flake8-pyi | Rule has been stable since v0.0.283Automatic fix availableEnabled by default |
PYI020 |
quoted-annotation-in-stubQuoted annotations should not be included in stubs |
style | flake8-pyi | Rule has been stable since v0.0.265Automatic fix availableEnabled by default |
PYI021 |
docstring-in-stubDocstrings should not be included in stubs |
pedantic | flake8-pyi | Rule has been stable since v0.0.253Automatic fix available |
PYI024 |
collections-named-tupleUse typing.NamedTuple instead of collections.namedtuple |
pedantic | flake8-pyi | Rule has been stable since v0.0.271 |
PYI025 |
unaliased-collections-abc-set-importUse from collections.abc import Set as AbstractSet to avoid confusion with the set builtin |
style | flake8-pyi | Rule has been stable since v0.0.271Automatic fix availableEnabled by default |
PYI026 |
type-alias-without-annotationUse {module}.TypeAlias for type alias, e.g., {name}: TypeAlias = {value} |
style | flake8-pyi | Rule has been stable since v0.0.279Automatic fix availableEnabled by default |
PYI029 |
str-or-repr-defined-in-stubDefining {name} in a stub is almost always redundant |
style | flake8-pyi | Rule has been stable since v0.0.271Automatic fix availableEnabled by default |
PYI030 |
unnecessary-literal-unionMultiple literal members in a union. Use a single literal, e.g. Literal[{}] |
complexity | flake8-pyi | Rule has been stable since v0.0.278Automatic fix availableEnabled by default |
PYI032 |
any-eq-ne-annotationPrefer object to Any for the second parameter to {method_name} |
style | flake8-pyi | Rule has been stable since v0.0.271Automatic fix availableEnabled by default |
PYI033 |
legacy-type-commentDon't use type comments |
suspicious | flake8-pyi | Rule has been stable since v0.0.254Enabled by default |
PYI034 |
non-self-return-type__new__ methods usually return self at runtime |
suspicious | flake8-pyi | Rule has been stable since v0.0.271Automatic fix availableEnabled by default |
PYI035 |
unassigned-special-variable-in-stub{name} in a stub file must have a value, as it has the same semantics as {name} at runtime |
correctness | flake8-pyi | Rule has been stable since v0.0.271Enabled by default |
PYI036 |
bad-exit-annotationStar-args in {method_name} should be annotated with object |
suspicious | flake8-pyi | Rule has been stable since v0.0.279Automatic fix availableEnabled by default |
PYI041 |
redundant-numeric-unionUse {supertype} instead of {subtype} | {supertype} |
complexity | flake8-pyi | Rule has been stable since v0.0.279Automatic fix availableEnabled by default |
PYI042 |
snake-case-type-aliasType alias {name} should be CamelCase |
style | flake8-pyi | Rule has been stable since v0.0.265Enabled by default |
PYI043 |
t-suffixed-type-aliasPrivate type alias {name} should not be suffixed with T (the T suffix implies that an object is a TypeVar) |
style | flake8-pyi | Rule has been stable since v0.0.265Enabled by default |
PYI044 |
future-annotations-in-stubfrom __future__ import annotations has no effect in stub files, since type checkers automatically treat stubs as having those semantics |
correctness | flake8-pyi | Rule has been stable since v0.0.273Automatic fix availableEnabled by default |
PYI045 |
iter-method-return-iterable__aiter__ methods should return an AsyncIterator, not an AsyncIterable |
correctness | flake8-pyi | Rule has been stable since v0.0.271Enabled by default |
PYI046 |
unused-private-protocolPrivate protocol {name} is never used |
suspicious | flake8-pyi | Rule has been stable since v0.0.281Enabled by default |
PYI047 |
unused-private-type-aliasPrivate TypeAlias {name} is never used |
suspicious | flake8-pyi | Rule has been stable since v0.0.281Enabled by default |
PYI048 |
stub-body-multiple-statementsFunction body must contain exactly one statement |
correctness | flake8-pyi | Rule has been stable since v0.0.271Enabled by default |
PYI049 |
unused-private-typed-dictPrivate TypedDict {name} is never used |
suspicious | flake8-pyi | Rule has been stable since v0.0.281Enabled by default |
PYI050 |
no-return-argument-annotation-in-stubPrefer {module}.Never over NoReturn for argument annotations |
style | flake8-pyi | Rule has been stable since v0.0.272Enabled by default |
PYI051 |
redundant-literal-unionLiteral[{literal}] is redundant in a union with {builtin_type} |
pedantic | flake8-pyi | Rule has been stable since v0.0.283 |
PYI052 |
unannotated-assignment-in-stubNeed type annotation for {name} |
suspicious | flake8-pyi | Rule has been stable since v0.0.269Enabled by default |
PYI053 |
string-or-bytes-too-longString and bytes literals longer than 50 characters are not permitted |
pedantic | flake8-pyi | Rule has been stable since v0.0.271Automatic fix available |
PYI054 |
numeric-literal-too-longNumeric literals with a string representation longer than ten characters are not permitted |
pedantic | flake8-pyi | Rule has been stable since v0.0.271Automatic fix available |
PYI055 |
unnecessary-type-unionMultiple type members in a union. Combine them into one, e.g., type[{union_str}]. |
complexity | flake8-pyi | Rule has been stable since v0.0.283Automatic fix availableEnabled by default |
PYI056 |
unsupported-method-call-on-allCalling .{name}() on __all__ may not be supported by all type checkers (use += instead) |
pedantic | flake8-pyi | Rule has been stable since v0.0.281 |
PYI057 |
byte-string-usageDo not use {origin}.ByteString, which has unclear semantics and is deprecated |
suspicious | flake8-pyi | Rule has been stable since 0.6.0Enabled by default |
PYI058 |
generator-return-from-iter-methodUse {return_type} as the return value for simple {method} methods |
style | flake8-pyi | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
PYI059 |
generic-not-last-base-classGeneric[] should always be the last base class |
correctness | flake8-pyi | Rule has been stable since 0.13.0Automatic fix availableEnabled by default |
PYI061 |
redundant-none-literalUse None rather than Literal[None] |
style | flake8-pyi | Rule has been stable since 0.13.0Automatic fix availableEnabled by default |
PYI062 |
duplicate-literal-memberDuplicate literal member {} |
suspicious | flake8-pyi | Rule has been stable since 0.6.0Automatic fix availableEnabled by default |
PYI063 |
pep484-style-positional-only-parameterUse PEP 570 syntax for positional-only parameters |
style | flake8-pyi | Rule has been stable since 0.8.0Enabled by default |
PYI064 |
redundant-final-literalFinal[Literal[{literal}]] can be replaced with a bare Final |
complexity | flake8-pyi | Rule has been stable since 0.8.0Automatic fix availableEnabled by default |
PYI066 |
bad-version-info-orderPut branches for newer Python versions first when branching on sys.version_info comparisons |
style | flake8-pyi | Rule has been stable since 0.8.0Enabled by default |
PT001 |
pytest-fixture-incorrect-parentheses-styleUse @pytest.fixture{expected} over @pytest.fixture{actual} |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT002 |
pytest-fixture-positional-argsConfiguration for fixture {function} specified via positional args, use kwargs |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT003 |
pytest-extraneous-scope-functionscope='function' is implied in @pytest.fixture() |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT004 |
pytest-missing-fixture-name-underscoreFixture {function} does not return anything, add leading underscore |
pedantic | flake8-pytest-style | Rule was removed in 0.8.0 |
PT005 |
pytest-incorrect-fixture-name-underscoreFixture {function} returns a value, remove leading underscore |
pedantic | flake8-pytest-style | Rule was removed in 0.8.0 |
PT006 |
pytest-parametrize-names-wrong-typeWrong type passed to first argument of pytest.mark.parametrize; expected {expected_string} |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT007 |
pytest-parametrize-values-wrong-typeWrong values type in pytest.mark.parametrize expected {values} |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT008 |
pytest-patch-with-lambdaUse return_value= instead of patching with lambda |
complexity | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT009 |
pytest-unittest-assertionUse a regular assert instead of unittest-style {assertion} |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT010 |
pytest-raises-without-exceptionSet the expected exception in pytest.raises() |
correctness | flake8-pytest-style | Rule has been stable since v0.0.208Enabled by default |
PT011 |
pytest-raises-too-broadpytest.raises({exception}) is too broad, set the match parameter or use a more specific exception |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT012 |
pytest-raises-with-multiple-statementspytest.raises() block should contain a single simple statement |
suspicious | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT013 |
pytest-incorrect-pytest-importIncorrect import of pytest; use import pytest instead |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT014 |
pytest-duplicate-parametrize-test-casesDuplicate of test case at index {index} in pytest.mark.parametrize |
correctness | flake8-pytest-style | Rule has been stable since v0.0.285Automatic fix availableEnabled by default |
PT015 |
pytest-assert-always-falseAssertion always fails, replace with pytest.fail() |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT016 |
pytest-fail-without-messageNo message passed to pytest.fail() |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT017 |
pytest-assert-in-exceptFound assertion on exception {name} in except block, use pytest.raises() instead |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT018 |
pytest-composite-assertionAssertion should be broken down into multiple parts |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT019 |
pytest-fixture-param-without-valueFixture {name} without value is injected as parameter, use @pytest.mark.usefixtures instead |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT020 |
pytest-deprecated-yield-fixture@pytest.yield_fixture is deprecated, use @pytest.fixture |
suspicious | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
PT021 |
pytest-fixture-finalizer-callbackUse yield instead of request.addfinalizer |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208 |
PT022 |
pytest-useless-yield-fixtureNo teardown in fixture {name}, use return instead of yield |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT023 |
pytest-incorrect-mark-parentheses-styleUse @pytest.mark.{mark_name}{expected_parens} over @pytest.mark.{mark_name}{actual_parens} |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT024 |
pytest-unnecessary-asyncio-mark-on-fixturepytest.mark.asyncio is unnecessary for fixtures |
correctness | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix available |
PT025 |
pytest-erroneous-use-fixtures-on-fixturepytest.mark.usefixtures has no effect on fixtures |
correctness | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
PT026 |
pytest-use-fixtures-without-parametersUseless pytest.mark.usefixtures without parameters |
correctness | flake8-pytest-style | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
PT027 |
pytest-unittest-raises-assertionUse pytest.raises instead of unittest-style {assertion} |
pedantic | flake8-pytest-style | Rule has been stable since v0.0.285Automatic fix available |
PT028 |
pytest-parameter-with-default-argumentTest function parameter {} has default argument |
suspicious | flake8-pytest-style | Rule has been stable since 0.12.0 |
PT029 |
pytest-warns-without-warningSet the expected warning in pytest.warns() |
pedantic | flake8-pytest-style | Rule has been in preview since 0.9.2 |
PT030 |
pytest-warns-too-broadpytest.warns({warning}) is too broad, set the match parameter or use a more specific warning |
pedantic | flake8-pytest-style | Rule has been stable since 0.12.0 |
PT031 |
pytest-warns-with-multiple-statementspytest.warns() block should contain a single simple statement |
suspicious | flake8-pytest-style | Rule has been stable since 0.12.0Enabled by default |
Q000 |
bad-quotes-inline-stringSingle quotes found but double quotes preferred |
formatting | flake8-quotes | Rule has been stable since v0.0.88Automatic fix available |
Q001 |
bad-quotes-multiline-stringSingle quote multiline found but double quotes preferred |
formatting | flake8-quotes | Rule has been stable since v0.0.88Automatic fix available |
Q002 |
bad-quotes-docstringSingle quote docstring found but double quotes preferred |
formatting | flake8-quotes | Rule has been stable since v0.0.88Automatic fix available |
Q003 |
avoidable-escaped-quoteChange outer quotes to avoid escaping inner quotes |
formatting | flake8-quotes | Rule has been stable since v0.0.88Automatic fix available |
Q004 |
unnecessary-escaped-quoteUnnecessary escape on inner quote character |
formatting | flake8-quotes | Rule has been stable since v0.2.0Automatic fix available |
RSE102 |
unnecessary-paren-on-raise-exceptionUnnecessary parentheses on raised exception |
pedantic | flake8-raise | Rule has been stable since v0.0.239Automatic fix available |
RET501 |
unnecessary-return-noneDo not explicitly return None in function if it is the only possible return value |
style | flake8-return | Rule has been stable since v0.0.154Automatic fix availableEnabled by default |
RET502 |
implicit-return-valueDo not implicitly return None in function able to return non-None value |
pedantic | flake8-return | Rule has been stable since v0.0.154Automatic fix available |
RET503 |
implicit-returnMissing explicit return at the end of function able to return non-None value |
pedantic | flake8-return | Rule has been stable since v0.0.154Automatic fix available |
RET504 |
unnecessary-assignUnnecessary assignment to {name} before return statement |
pedantic | flake8-return | Rule has been stable since v0.0.154Automatic fix available |
RET505 |
superfluous-else-returnUnnecessary {branch} after return statement |
pedantic | flake8-return | Rule has been stable since v0.0.154Automatic fix available |
RET506 |
superfluous-else-raiseUnnecessary {branch} after raise statement |
pedantic | flake8-return | Rule has been stable since v0.0.154Automatic fix available |
RET507 |
superfluous-else-continueUnnecessary {branch} after continue statement |
pedantic | flake8-return | Rule has been stable since v0.0.154Automatic fix available |
RET508 |
superfluous-else-breakUnnecessary {branch} after break statement |
pedantic | flake8-return | Rule has been stable since v0.0.154Automatic fix available |
SLF001 |
private-member-accessPrivate member accessed: {access} |
pedantic | flake8-self | Rule has been stable since v0.0.240 |
SIM101 |
duplicate-isinstance-callMultiple isinstance calls for {name}, merge into a single call |
complexity | flake8-simplify | Rule has been stable since v0.0.212Automatic fix availableEnabled by default |
SIM102 |
collapsible-ifUse a single if statement instead of nested if statements |
complexity | flake8-simplify | Rule has been stable since v0.0.211Automatic fix availableEnabled by default |
SIM103 |
needless-boolReturn the condition {condition} directly |
complexity | flake8-simplify | Rule has been stable since v0.0.214Automatic fix availableEnabled by default |
SIM105 |
suppressible-exceptionUse contextlib.suppress({exception}) instead of try-except-pass |
pedantic | flake8-simplify | Rule has been stable since v0.0.211Automatic fix available |
SIM107 |
return-in-try-except-finallyDon't use return in try-except and finally |
correctness | flake8-simplify | Rule has been stable since v0.0.211Enabled by default |
SIM108 |
if-else-block-instead-of-if-expUse ternary operator {contents} instead of if-else-block |
pedantic | flake8-simplify | Rule has been stable since v0.0.213Automatic fix available |
SIM109 |
compare-with-tupleUse {replacement} instead of multiple equality comparisons |
pedantic | flake8-simplify | Rule has been stable since v0.0.213Automatic fix available |
SIM110 |
reimplemented-builtinUse {replacement} instead of for loop |
complexity | flake8-simplify | Rule has been stable since v0.0.211Automatic fix available |
SIM112 |
uncapitalized-environment-variablesUse capitalized environment variable {expected} instead of {actual} |
pedantic | flake8-simplify | Rule has been stable since v0.0.218Automatic fix available |
SIM113 |
enumerate-for-loopUse enumerate() for index variable {index} in for loop |
complexity | flake8-simplify | Rule has been stable since v0.2.0Enabled by default |
SIM114 |
if-with-same-armsCombine if branches using logical or operator |
suspicious | flake8-simplify | Rule has been stable since v0.0.246Automatic fix availableEnabled by default |
SIM115 |
open-file-with-context-handlerUse a context manager for opening files |
suspicious | flake8-simplify | Rule has been stable since v0.0.219Enabled by default |
SIM116 |
if-else-block-instead-of-dict-lookupUse a dictionary instead of consecutive if statements |
pedantic | flake8-simplify | Rule has been stable since v0.0.250 |
SIM117 |
multiple-with-statementsUse a single with statement with multiple contexts instead of nested with statements |
complexity | flake8-simplify | Rule has been stable since v0.0.211Automatic fix availableEnabled by default |
SIM118 |
in-dict-keysUse key {operator} dict instead of key {operator} dict.keys() |
complexity | flake8-simplify | Rule has been stable since v0.0.176Automatic fix availableEnabled by default |
SIM201 |
negate-equal-opUse {left} != {right} instead of not {left} == {right} |
complexity | flake8-simplify | Rule has been stable since v0.0.213Automatic fix availableEnabled by default |
SIM202 |
negate-not-equal-opUse {left} == {right} instead of not {left} != {right} |
complexity | flake8-simplify | Rule has been stable since v0.0.213Automatic fix availableEnabled by default |
SIM208 |
double-negationUse {expr} instead of not (not {expr}) |
complexity | flake8-simplify | Rule has been stable since v0.0.213Automatic fix availableEnabled by default |
SIM210 |
if-expr-with-true-falseRemove unnecessary True if ... else False |
complexity | flake8-simplify | Rule has been stable since v0.0.214Automatic fix availableEnabled by default |
SIM211 |
if-expr-with-false-trueUse not ... instead of False if ... else True |
complexity | flake8-simplify | Rule has been stable since v0.0.214Automatic fix availableEnabled by default |
SIM212 |
if-expr-with-twisted-armsUse {expr_else} if {expr_else} else {expr_body} instead of {expr_body} if not {expr_else} else {expr_else} |
pedantic | flake8-simplify | Rule has been stable since v0.0.214Automatic fix available |
SIM220 |
expr-and-not-exprUse False instead of {name} and not {name} |
correctness | flake8-simplify | Rule has been stable since v0.0.211Automatic fix availableEnabled by default |
SIM221 |
expr-or-not-exprUse True instead of {name} or not {name} |
correctness | flake8-simplify | Rule has been stable since v0.0.211Automatic fix availableEnabled by default |
SIM222 |
expr-or-trueUse {expr} instead of {replaced} |
correctness | flake8-simplify | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
SIM223 |
expr-and-falseUse {expr} instead of {replaced} |
correctness | flake8-simplify | Rule has been stable since v0.0.208Automatic fix availableEnabled by default |
SIM300 |
yoda-conditionsYoda condition detected |
pedantic | flake8-simplify | Rule has been stable since v0.0.207Automatic fix available |
SIM401 |
if-else-block-instead-of-dict-getUse {contents} instead of an if block |
complexity | flake8-simplify | Rule has been stable since v0.0.219Automatic fix availableEnabled by default |
SIM905 |
split-static-stringConsider using a list literal instead of str.{} |
complexity | flake8-simplify | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
SIM910 |
dict-get-with-none-defaultUse {expected} instead of {actual} |
pedantic | flake8-simplify | Rule has been stable since v0.0.261Automatic fix available |
SIM911 |
zip-dict-keys-and-valuesUse {expected} instead of {actual} |
complexity | flake8-simplify | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
SLOT000 |
no-slots-in-str-subclassSubclasses of str should define __slots__ |
pedantic | flake8-slots | Rule has been stable since v0.0.273 |
SLOT001 |
no-slots-in-tuple-subclassSubclasses of tuple should define __slots__ |
pedantic | flake8-slots | Rule has been stable since v0.0.273 |
SLOT002 |
no-slots-in-namedtuple-subclassSubclasses of {namedtuple_kind} should define __slots__ |
pedantic | flake8-slots | Rule has been stable since v0.0.273 |
TID251 |
banned-api{name} is banned: {message} |
restriction | flake8-tidy-imports | Rule has been stable since v0.0.201 |
TID252 |
relative-importsPrefer absolute imports over relative imports from parent modules |
restriction | flake8-tidy-imports | Rule has been stable since v0.0.169Automatic fix available |
TID253 |
banned-module-level-imports{name} is banned at the module level |
restriction | flake8-tidy-imports | Rule has been stable since v0.0.285 |
TID254 |
lazy-import-mismatch{name} should be imported lazily |
restriction | flake8-tidy-imports | Rule has been in preview since 0.15.6Automatic fix available |
TID255 |
lazy-import-immediately-resolvedLazy import {name} is resolved immediately |
correctness | flake8-tidy-imports | Rule has been in preview since 0.15.13Automatic fix available |
TD001 |
invalid-todo-tagInvalid TODO tag: {tag} |
pedantic | flake8-todos | Rule has been stable since v0.0.269 |
TD002 |
missing-todo-authorMissing author in TODO; try: # TODO(<author_name>): ... or # TODO @<author_name>: ... |
pedantic | flake8-todos | Rule has been stable since v0.0.269 |
TD003 |
missing-todo-linkMissing issue link for this TODO |
pedantic | flake8-todos | Rule has been stable since v0.0.269 |
TD004 |
missing-todo-colonMissing colon in TODO |
pedantic | flake8-todos | Rule has been stable since v0.0.269 |
TD005 |
missing-todo-descriptionMissing issue description after TODO |
pedantic | flake8-todos | Rule has been stable since v0.0.269 |
TD006 |
invalid-todo-capitalizationInvalid TODO capitalization: {tag} should be TODO |
pedantic | flake8-todos | Rule has been stable since v0.0.269Automatic fix available |
TD007 |
missing-space-after-todo-colonMissing space after colon in TODO |
pedantic | flake8-todos | Rule has been stable since v0.0.269 |
TC001 |
typing-only-first-party-importMove application import {} into a type-checking block |
pedantic | flake8-type-checking | Rule has been stable since 0.8.0Automatic fix available |
TC002 |
typing-only-third-party-importMove third-party import {} into a type-checking block |
pedantic | flake8-type-checking | Rule has been stable since 0.8.0Automatic fix available |
TC003 |
typing-only-standard-library-importMove standard library import {} into a type-checking block |
pedantic | flake8-type-checking | Rule has been stable since 0.8.0Automatic fix available |
TC004 |
runtime-import-in-type-checking-blockMove import {qualified_name} out of type-checking block. Import is used for more than type hinting. |
correctness | flake8-type-checking | Rule has been stable since 0.8.0Automatic fix availableEnabled by default |
TC005 |
empty-type-checking-blockFound empty type-checking block |
suspicious | flake8-type-checking | Rule has been stable since 0.8.0Automatic fix availableEnabled by default |
TC006 |
runtime-cast-valueAdd quotes to type expression in typing.cast() |
pedantic | flake8-type-checking | Rule has been stable since 0.10.0Automatic fix available |
TC007 |
unquoted-type-aliasAdd quotes to type alias |
correctness | flake8-type-checking | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
TC008 |
quoted-type-aliasRemove quotes from type alias |
pedantic | flake8-type-checking | Rule has been in preview since 0.8.1Automatic fix available |
TC010 |
runtime-string-unionInvalid string member in X | Y-style union type |
correctness | flake8-type-checking | Rule has been stable since 0.8.0Enabled by default |
ARG001 |
unused-function-argumentUnused function argument: {name} |
pedantic | flake8-unused-arguments | Rule has been stable since v0.0.168 |
ARG002 |
unused-method-argumentUnused method argument: {name} |
pedantic | flake8-unused-arguments | Rule has been stable since v0.0.168 |
ARG003 |
unused-class-method-argumentUnused class method argument: {name} |
pedantic | flake8-unused-arguments | Rule has been stable since v0.0.168 |
ARG004 |
unused-static-method-argumentUnused static method argument: {name} |
pedantic | flake8-unused-arguments | Rule has been stable since v0.0.168 |
ARG005 |
unused-lambda-argumentUnused lambda argument: {name} |
pedantic | flake8-unused-arguments | Rule has been stable since v0.0.168 |
PTH100 |
os-path-abspathos.path.abspath() should be replaced by Path.resolve() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH101 |
os-chmodos.chmod() should be replaced by Path.chmod() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH102 |
os-mkdiros.mkdir() should be replaced by Path.mkdir() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH103 |
os-makedirsos.makedirs() should be replaced by Path.mkdir(parents=True) |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH104 |
os-renameos.rename() should be replaced by Path.rename() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH105 |
os-replaceos.replace() should be replaced by Path.replace() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH106 |
os-rmdiros.rmdir() should be replaced by Path.rmdir() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH107 |
os-removeos.remove() should be replaced by Path.unlink() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH108 |
os-unlinkos.unlink() should be replaced by Path.unlink() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH109 |
os-getcwdos.getcwd() should be replaced by Path.cwd() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH110 |
os-path-existsos.path.exists() should be replaced by Path.exists() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH111 |
os-path-expanduseros.path.expanduser() should be replaced by Path.expanduser() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH112 |
os-path-isdiros.path.isdir() should be replaced by Path.is_dir() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH113 |
os-path-isfileos.path.isfile() should be replaced by Path.is_file() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH114 |
os-path-islinkos.path.islink() should be replaced by Path.is_symlink() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH115 |
os-readlinkos.readlink() should be replaced by Path.readlink() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH116 |
os-statos.stat() should be replaced by Path.stat(), Path.owner(), or Path.group() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH117 |
os-path-isabsos.path.isabs() should be replaced by Path.is_absolute() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH118 |
os-path-joinos.{module}.join() should be replaced by Path with / operator |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231 |
PTH119 |
os-path-basenameos.path.basename() should be replaced by Path.name |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH120 |
os-path-dirnameos.path.dirname() should be replaced by Path.parent |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH121 |
os-path-samefileos.path.samefile() should be replaced by Path.samefile() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH122 |
os-path-splitextos.path.splitext() should be replaced by Path.suffix, Path.stem, and Path.parent |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231 |
PTH123 |
builtin-openopen() should be replaced by Path.open() |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.231Automatic fix available |
PTH124 |
py-pathpy.path is in maintenance mode, use pathlib instead |
suspicious | flake8-use-pathlib | Rule has been stable since v0.0.231Enabled by default |
PTH201 |
path-constructor-current-directoryDo not pass the current directory explicitly to Path |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.279Automatic fix available |
PTH202 |
os-path-getsizeos.path.getsize should be replaced by Path.stat().st_size |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.279Automatic fix available |
PTH203 |
os-path-getatimeos.path.getatime should be replaced by Path.stat().st_atime |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.279Automatic fix available |
PTH204 |
os-path-getmtimeos.path.getmtime should be replaced by Path.stat().st_mtime |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.279Automatic fix available |
PTH205 |
os-path-getctimeos.path.getctime should be replaced by Path.stat().st_ctime |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.279Automatic fix available |
PTH206 |
os-sep-splitReplace .split(os.sep) with Path.parts |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.281 |
PTH207 |
globReplace {function} with Path.glob or Path.rglob |
pedantic | flake8-use-pathlib | Rule has been stable since v0.0.281 |
PTH208 |
os-listdirUse pathlib.Path.iterdir() instead. |
pedantic | flake8-use-pathlib | Rule has been stable since 0.10.0Automatic fix available |
PTH210 |
invalid-pathlib-with-suffixInvalid suffix passed to .with_suffix() |
correctness | flake8-use-pathlib | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
PTH211 |
os-symlinkos.symlink should be replaced by Path.symlink_to |
pedantic | flake8-use-pathlib | Rule has been stable since 0.13.0Automatic fix available |
FLY002 |
static-join-to-f-stringConsider {expression} instead of string join |
complexity | flynt | Rule has been stable since v0.0.266Automatic fix availableEnabled by default |
I001 |
unsorted-importsImport block is un-sorted or un-formatted |
style | isort | Rule has been stable since v0.0.110Automatic fix availableEnabled by default |
I002 |
missing-required-importMissing required import: {name} |
pedantic | isort | Rule has been stable since v0.0.218Automatic fix available |
C901 |
complex-structure{name} is too complex ({complexity} > {max_complexity}) |
restriction | mccabe | Rule has been stable since v0.0.127 |
NPY001 |
numpy-deprecated-type-aliasType alias np.{type_name} is deprecated, replace with builtin type |
suspicious | NumPy | Rule has been stable since v0.0.247Automatic fix available |
NPY002 |
numpy-legacy-randomReplace legacy np.random.{method_name} call with np.random.Generator |
suspicious | NumPy | Rule has been stable since v0.0.248 |
NPY003 |
numpy-deprecated-functionnp.{existing} is deprecated; use np.{replacement} instead |
suspicious | NumPy | Rule has been stable since v0.0.276Automatic fix available |
NPY201 |
numpy2-deprecationnp.{existing} will be removed in NumPy 2.0. {migration_guide} |
suspicious | NumPy | Rule has been stable since v0.2.0Automatic fix available |
PD002 |
pandas-use-of-inplace-argumentinplace=True should be avoided; it has inconsistent behavior |
pedantic | pandas-vet | Rule has been stable since v0.0.188Automatic fix available |
PD003 |
pandas-use-of-dot-is-null.isna is preferred to .isnull; functionality is equivalent |
style | pandas-vet | Rule has been stable since v0.0.188 |
PD004 |
pandas-use-of-dot-not-null.notna is preferred to .notnull; functionality is equivalent |
style | pandas-vet | Rule has been stable since v0.0.188 |
PD007 |
pandas-use-of-dot-ix.ix is deprecated; use more explicit .loc or .iloc |
pedantic | pandas-vet | Rule has been stable since v0.0.188 |
PD008 |
pandas-use-of-dot-atUse .loc instead of .at. If speed is important, use NumPy. |
pedantic | pandas-vet | Rule has been stable since v0.0.188 |
PD009 |
pandas-use-of-dot-iatUse .iloc instead of .iat. If speed is important, use NumPy. |
pedantic | pandas-vet | Rule has been stable since v0.0.188 |
PD010 |
pandas-use-of-dot-pivot-or-unstack.pivot_table is preferred to .pivot or .unstack; provides same functionality |
pedantic | pandas-vet | Rule has been stable since v0.0.188 |
PD011 |
pandas-use-of-dot-valuesUse .to_numpy() or .array instead of .values |
pedantic | pandas-vet | Rule has been stable since v0.0.188 |
PD012 |
pandas-use-of-dot-read-tableUse .read_csv instead of .read_table to read CSV files |
complexity | pandas-vet | Rule has been stable since v0.0.188 |
PD013 |
pandas-use-of-dot-stack.melt is preferred to .stack; provides same functionality |
pedantic | pandas-vet | Rule has been stable since v0.0.188 |
PD015 |
pandas-use-of-pd-mergeUse .merge method instead of pd.merge function. They have equivalent functionality. |
style | pandas-vet | Rule has been stable since v0.0.188 |
PD101 |
pandas-nunique-constant-series-checkUsing series.nunique() for checking that a series is constant is inefficient |
pedantic | pandas-vet | Rule has been stable since v0.0.279 |
PD901 |
pandas-df-variable-nameAvoid using the generic variable name df for DataFrames |
pedantic | pandas-vet | Rule was removed in 0.13.0 |
N801 |
invalid-class-nameClass name {name} should use CapWords convention |
pedantic | pep8-naming | Rule has been stable since v0.0.77 |
N802 |
invalid-function-nameFunction name {name} should be lowercase |
pedantic | pep8-naming | Rule has been stable since v0.0.77 |
N803 |
invalid-argument-nameArgument name {name} should be lowercase |
pedantic | pep8-naming | Rule has been stable since v0.0.77 |
N804 |
invalid-first-argument-name-for-class-methodFirst argument of a class method should be named cls |
pedantic | pep8-naming | Rule has been stable since v0.0.77Automatic fix available |
N805 |
invalid-first-argument-name-for-methodFirst argument of a method should be named self |
pedantic | pep8-naming | Rule has been stable since v0.0.77Automatic fix available |
N806 |
non-lowercase-variable-in-functionVariable {name} in function should be lowercase |
pedantic | pep8-naming | Rule has been stable since v0.0.89 |
N807 |
dunder-function-nameFunction name should not start and end with __ |
pedantic | pep8-naming | Rule has been stable since v0.0.82 |
N811 |
constant-imported-as-non-constantConstant {name} imported as non-constant {asname} |
pedantic | pep8-naming | Rule has been stable since v0.0.82 |
N812 |
lowercase-imported-as-non-lowercaseLowercase {name} imported as non-lowercase {asname} |
pedantic | pep8-naming | Rule has been stable since v0.0.82 |
N813 |
camelcase-imported-as-lowercaseCamelcase {name} imported as lowercase {asname} |
pedantic | pep8-naming | Rule has been stable since v0.0.82 |
N814 |
camelcase-imported-as-constantCamelcase {name} imported as constant {asname} |
pedantic | pep8-naming | Rule has been stable since v0.0.82 |
N815 |
mixed-case-variable-in-class-scopeVariable {name} in class scope should not be mixedCase |
pedantic | pep8-naming | Rule has been stable since v0.0.89 |
N816 |
mixed-case-variable-in-global-scopeVariable {name} in global scope should not be mixedCase |
pedantic | pep8-naming | Rule has been stable since v0.0.89 |
N817 |
camelcase-imported-as-acronymCamelCase {name} imported as acronym {asname} |
pedantic | pep8-naming | Rule has been stable since v0.0.82 |
N818 |
error-suffix-on-exception-nameException name {name} should be named with an Error suffix |
pedantic | pep8-naming | Rule has been stable since v0.0.89 |
N999 |
invalid-module-nameInvalid module name: '{name}' |
style | pep8-naming | Rule has been stable since v0.0.248Enabled by default |
PERF101 |
unnecessary-list-castDo not cast an iterable to list before iterating over it |
performance | Perflint | Rule has been stable since v0.0.276Automatic fix availableEnabled by default |
PERF102 |
incorrect-dict-iteratorWhen using only the {subset} of a dict use the {subset}() method |
complexity | Perflint | Rule has been stable since v0.0.273Automatic fix availableEnabled by default |
PERF203 |
try-except-in-looptry-except within a loop incurs performance overhead |
pedantic | Perflint | Rule has been stable since v0.0.276 |
PERF401 |
manual-list-comprehensionUse {message_str} to create a transformed list |
pedantic | Perflint | Rule has been stable since v0.0.276Automatic fix available |
PERF402 |
manual-list-copyUse list or list.copy to create a copy of a list |
complexity | Perflint | Rule has been stable since v0.0.276Enabled by default |
PERF403 |
manual-dict-comprehensionUse a dictionary comprehension instead of {modifier} for-loop |
pedantic | Perflint | Rule has been stable since 0.5.0Automatic fix available |
E101 |
mixed-spaces-and-tabsIndentation contains mixed spaces and tabs |
formatting | pycodestyle | Rule has been stable since v0.0.229 |
E111 |
indentation-with-invalid-multipleIndentation is not a multiple of {indent_width} |
formatting | pycodestyle | Rule has been in preview since v0.0.269 |
E112 |
no-indented-blockExpected an indented block |
pedantic | pycodestyle | Rule has been in preview since v0.0.269 |
E113 |
unexpected-indentationUnexpected indentation |
pedantic | pycodestyle | Rule has been in preview since v0.0.269 |
E114 |
indentation-with-invalid-multiple-commentIndentation is not a multiple of {indent_width} (comment) |
formatting | pycodestyle | Rule has been in preview since v0.0.269 |
E115 |
no-indented-block-commentExpected an indented block (comment) |
formatting | pycodestyle | Rule has been in preview since v0.0.269 |
E116 |
unexpected-indentation-commentUnexpected indentation (comment) |
formatting | pycodestyle | Rule has been in preview since v0.0.269 |
E117 |
over-indentedOver-indented (comment) |
formatting | pycodestyle | Rule has been in preview since v0.0.269 |
E201 |
whitespace-after-open-bracketWhitespace after '{symbol}' |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E202 |
whitespace-before-close-bracketWhitespace before '{symbol}' |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E203 |
whitespace-before-punctuationWhitespace before '{symbol}' |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E204 |
whitespace-after-decoratorWhitespace after decorator |
formatting | pycodestyle | Rule has been in preview since 0.5.1Automatic fix available |
E211 |
whitespace-before-parametersWhitespace before '{bracket}' |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E221 |
multiple-spaces-before-operatorMultiple spaces before operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E222 |
multiple-spaces-after-operatorMultiple spaces after operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E223 |
tab-before-operatorTab before operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E224 |
tab-after-operatorTab after operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E225 |
missing-whitespace-around-operatorMissing whitespace around operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E226 |
missing-whitespace-around-arithmetic-operatorMissing whitespace around arithmetic operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E227 |
missing-whitespace-around-bitwise-or-shift-operatorMissing whitespace around bitwise or shift operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E228 |
missing-whitespace-around-modulo-operatorMissing whitespace around modulo operator |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E231 |
missing-whitespaceMissing whitespace after {} |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E241 |
multiple-spaces-after-commaMultiple spaces after comma |
formatting | pycodestyle | Rule has been in preview since v0.0.281Automatic fix available |
E242 |
tab-after-commaTab after comma |
formatting | pycodestyle | Rule has been in preview since v0.0.281Automatic fix available |
E251 |
unexpected-spaces-around-keyword-parameter-equalsUnexpected spaces around keyword / parameter equals |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E252 |
missing-whitespace-around-parameter-equalsMissing whitespace around parameter equals |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E261 |
too-few-spaces-before-inline-commentInsert at least two spaces before an inline comment |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E262 |
no-space-after-inline-commentInline comment should start with # |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E265 |
no-space-after-block-commentBlock comment should start with # |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E266 |
multiple-leading-hashes-for-block-commentToo many leading # before block comment |
pedantic | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E271 |
multiple-spaces-after-keywordMultiple spaces after keyword |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E272 |
multiple-spaces-before-keywordMultiple spaces before keyword |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E273 |
tab-after-keywordTab after keyword |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E274 |
tab-before-keywordTab before keyword |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E275 |
missing-whitespace-after-keywordMissing whitespace after keyword |
formatting | pycodestyle | Rule has been in preview since v0.0.269Automatic fix available |
E301 |
blank-line-between-methodsExpected {BLANK_LINES_NESTED_LEVEL:?} blank line, found 0 |
formatting | pycodestyle | Rule has been in preview since v0.2.2Automatic fix available |
E302 |
blank-lines-top-levelExpected {expected_blank_lines:?} blank lines, found {actual_blank_lines} |
formatting | pycodestyle | Rule has been in preview since v0.2.2Automatic fix available |
E303 |
too-many-blank-linesToo many blank lines ({actual_blank_lines}) |
formatting | pycodestyle | Rule has been in preview since v0.2.2Automatic fix available |
E304 |
blank-line-after-decoratorBlank lines found after function decorator ({lines}) |
formatting | pycodestyle | Rule has been in preview since v0.2.2Automatic fix available |
E305 |
blank-lines-after-function-or-classExpected 2 blank lines after class or function definition, found ({blank_lines}) |
formatting | pycodestyle | Rule has been in preview since v0.2.2Automatic fix available |
E306 |
blank-lines-before-nested-definitionExpected 1 blank line before a nested definition, found 0 |
formatting | pycodestyle | Rule has been in preview since v0.2.2Automatic fix available |
E401 |
multiple-imports-on-one-lineMultiple imports on one line |
pedantic | pycodestyle | Rule has been stable since v0.0.191Automatic fix available |
E402 |
module-import-not-at-top-of-fileModule level import not at top of cell |
pedantic | pycodestyle | Rule has been stable since v0.0.28Automatic fix available |
E501 |
line-too-longLine too long ({width} > {limit}) |
formatting | pycodestyle | Rule has been stable since v0.0.18 |
E502 |
redundant-backslashRedundant backslash |
formatting | pycodestyle | Rule has been in preview since v0.3.3Automatic fix available |
E701 |
multiple-statements-on-one-line-colonMultiple statements on one line (colon) |
formatting | pycodestyle | Rule has been stable since v0.0.245 |
E702 |
multiple-statements-on-one-line-semicolonMultiple statements on one line (semicolon) |
formatting | pycodestyle | Rule has been stable since v0.0.245 |
E703 |
useless-semicolonStatement ends with an unnecessary semicolon |
formatting | pycodestyle | Rule has been stable since v0.0.245Automatic fix available |
E711 |
none-comparisonComparison to None should be cond is None |
pedantic | pycodestyle | Rule has been stable since v0.0.28Automatic fix available |
E712 |
true-false-comparisonAvoid equality comparisons to True; use {cond}: for truth checks |
pedantic | pycodestyle | Rule has been stable since v0.0.28Automatic fix available |
E713 |
not-in-testTest for membership should be not in |
pedantic | pycodestyle | Rule has been stable since v0.0.28Automatic fix available |
E714 |
not-is-testTest for object identity should be is not |
pedantic | pycodestyle | Rule has been stable since v0.0.28Automatic fix available |
E721 |
type-comparisonUse is and is not for type comparisons, or isinstance() for isinstance checks |
pedantic | pycodestyle | Rule has been stable since v0.0.39 |
E722 |
bare-exceptDo not use bare except |
suspicious | pycodestyle | Rule has been stable since v0.0.36Enabled by default |
E731 |
lambda-assignmentDo not assign a lambda expression, use a def |
pedantic | pycodestyle | Rule has been stable since v0.0.28Automatic fix available |
E741 |
ambiguous-variable-nameAmbiguous variable name: {name} |
pedantic | pycodestyle | Rule has been stable since v0.0.34 |
E742 |
ambiguous-class-nameAmbiguous class name: {name} |
pedantic | pycodestyle | Rule has been stable since v0.0.35 |
E743 |
ambiguous-function-nameAmbiguous function name: {name} |
pedantic | pycodestyle | Rule has been stable since v0.0.35 |
E902 |
io-error{message} |
correctness | pycodestyle | Rule has been stable since v0.0.28Enabled by default |
E999 |
syntax-errorSyntaxError |
correctness | pycodestyle | Rule was removed in 0.8.0 |
W191 |
tab-indentationIndentation contains tabs |
formatting | pycodestyle | Rule has been stable since v0.0.254 |
W291 |
trailing-whitespaceTrailing whitespace |
formatting | pycodestyle | Rule has been stable since v0.0.253Automatic fix available |
W292 |
missing-newline-at-end-of-fileNo newline at end of file |
formatting | pycodestyle | Rule has been stable since v0.0.61Automatic fix available |
W293 |
blank-line-with-whitespaceBlank line contains whitespace |
formatting | pycodestyle | Rule has been stable since v0.0.253Automatic fix available |
W391 |
too-many-newlines-at-end-of-fileToo many newlines at end of {domain} |
formatting | pycodestyle | Rule has been in preview since v0.3.3Automatic fix available |
W505 |
doc-line-too-longDoc line too long ({width} > {limit}) |
formatting | pycodestyle | Rule has been stable since v0.0.219 |
W605 |
invalid-escape-sequenceInvalid escape sequence: \{ch} |
correctness | pycodestyle | Rule has been stable since v0.0.85Automatic fix availableEnabled by default |
DOC102 |
docstring-extraneous-parameterDocumented parameter {id} is not in the function's signature |
pedantic | pydoclint | Rule has been in preview since 0.14.1 |
DOC201 |
docstring-missing-returnsreturn is not documented in docstring |
pedantic | pydoclint | Rule has been in preview since 0.5.6 |
DOC202 |
docstring-extraneous-returnsDocstring should not have a returns section because the function doesn't return anything |
pedantic | pydoclint | Rule has been in preview since 0.5.6 |
DOC402 |
docstring-missing-yieldsyield is not documented in docstring |
pedantic | pydoclint | Rule has been in preview since 0.5.7 |
DOC403 |
docstring-extraneous-yieldsDocstring has a "Yields" section but the function doesn't yield anything |
pedantic | pydoclint | Rule has been in preview since 0.5.7 |
DOC501 |
docstring-missing-exceptionRaised exception {id} missing from docstring |
pedantic | pydoclint | Rule has been in preview since 0.5.5 |
DOC502 |
docstring-extraneous-exceptionRaised exception is not explicitly raised: {id} |
pedantic | pydoclint | Rule has been in preview since 0.5.5 |
D100 |
undocumented-public-moduleMissing docstring in public module |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D101 |
undocumented-public-classMissing docstring in public class |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D102 |
undocumented-public-methodMissing docstring in public method |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D103 |
undocumented-public-functionMissing docstring in public function |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D104 |
undocumented-public-packageMissing docstring in public package |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D105 |
undocumented-magic-methodMissing docstring in magic method |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D106 |
undocumented-public-nested-classMissing docstring in public nested class |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D107 |
undocumented-public-initMissing docstring in __init__ |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D200 |
unnecessary-multiline-docstringOne-line docstring should fit on one line |
pedantic | pydocstyle | Rule has been stable since v0.0.68Automatic fix available |
D201 |
blank-line-before-functionNo blank lines allowed before function docstring (found {num_lines}) |
formatting | pydocstyle | Rule has been stable since v0.0.70Automatic fix available |
D202 |
blank-line-after-functionNo blank lines allowed after function docstring (found {num_lines}) |
formatting | pydocstyle | Rule has been stable since v0.0.70Automatic fix available |
D203 |
incorrect-blank-line-before-class1 blank line required before class docstring |
formatting | pydocstyle | Rule has been stable since v0.0.70Automatic fix available |
D204 |
incorrect-blank-line-after-class1 blank line required after class docstring |
formatting | pydocstyle | Rule has been stable since v0.0.70Automatic fix available |
D205 |
missing-blank-line-after-summary1 blank line required between summary line and description |
pedantic | pydocstyle | Rule has been stable since v0.0.68Automatic fix available |
D206 |
docstring-tab-indentationDocstring should be indented with spaces, not tabs |
formatting | pydocstyle | Rule has been stable since v0.0.75 |
D207 |
under-indentationDocstring is under-indented |
formatting | pydocstyle | Rule has been stable since v0.0.75Automatic fix available |
D208 |
over-indentationDocstring is over-indented |
formatting | pydocstyle | Rule has been stable since v0.0.75Automatic fix available |
D209 |
new-line-after-last-paragraphMulti-line docstring closing quotes should be on a separate line |
pedantic | pydocstyle | Rule has been stable since v0.0.68Automatic fix available |
D210 |
surrounding-whitespaceNo whitespaces allowed surrounding docstring text |
formatting | pydocstyle | Rule has been stable since v0.0.68Automatic fix available |
D211 |
blank-line-before-classNo blank lines allowed before class docstring |
formatting | pydocstyle | Rule has been stable since v0.0.70Automatic fix available |
D212 |
multi-line-summary-first-lineMulti-line docstring summary should start at the first line |
pedantic | pydocstyle | Rule has been stable since v0.0.69Automatic fix available |
D213 |
multi-line-summary-second-lineMulti-line docstring summary should start at the second line |
pedantic | pydocstyle | Rule has been stable since v0.0.69Automatic fix available |
D214 |
overindented-sectionSection is over-indented ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.73Automatic fix available |
D215 |
overindented-section-underlineSection underline is over-indented ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.73Automatic fix available |
D300 |
triple-single-quotesUse triple double quotes """ |
formatting | pydocstyle | Rule has been stable since v0.0.69Automatic fix available |
D301 |
escape-sequence-in-docstringUse r""" if any backslashes in a docstring |
suspicious | pydocstyle | Rule has been stable since v0.0.172Automatic fix available |
D400 |
missing-trailing-periodFirst line should end with a period |
pedantic | pydocstyle | Rule has been stable since v0.0.68Automatic fix available |
D401 |
non-imperative-moodFirst line of docstring should be in imperative mood: "{first_line}" |
pedantic | pydocstyle | Rule has been stable since v0.0.228 |
D402 |
signature-in-docstringFirst line should not be the function's signature |
pedantic | pydocstyle | Rule has been stable since v0.0.70 |
D403 |
first-word-uncapitalizedFirst word of the docstring should be capitalized: {} -> {} |
pedantic | pydocstyle | Rule has been stable since v0.0.69Automatic fix available |
D404 |
docstring-starts-with-thisFirst word of the docstring should not be "This" |
pedantic | pydocstyle | Rule has been stable since v0.0.71 |
D405 |
non-capitalized-section-nameSection name should be properly capitalized ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D406 |
missing-new-line-after-section-nameSection name should end with a newline ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D407 |
missing-dashed-underline-after-sectionMissing dashed underline after section ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D408 |
missing-section-underline-after-nameSection underline should be in the line following the section's name ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D409 |
mismatched-section-underline-lengthSection underline should match the length of its name ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D410 |
no-blank-line-after-sectionMissing blank line after section ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D411 |
no-blank-line-before-sectionMissing blank line before section ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D412 |
blank-lines-between-header-and-contentNo blank lines allowed between a section header and its content ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D413 |
missing-blank-line-after-last-sectionMissing blank line after last section ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71Automatic fix available |
D414 |
empty-docstring-sectionSection has no content ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.71 |
D415 |
missing-terminal-punctuationFirst line should end with a period, question mark, or exclamation point |
pedantic | pydocstyle | Rule has been stable since v0.0.69Automatic fix available |
D416 |
missing-section-name-colonSection name should end with a colon ("{name}") |
pedantic | pydocstyle | Rule has been stable since v0.0.74Automatic fix available |
D417 |
undocumented-paramMissing argument description in the docstring for {definition}: {name} |
pedantic | pydocstyle | Rule has been stable since v0.0.73 |
D418 |
overload-with-docstringFunction decorated with @overload shouldn't contain a docstring |
pedantic | pydocstyle | Rule has been stable since v0.0.71 |
D419 |
empty-docstringDocstring is empty |
suspicious | pydocstyle | Rule has been stable since v0.0.68Enabled by default |
D420 |
incorrect-section-orderSection "{current}" appears after section "{previous}" but should be before it |
pedantic | pydocstyle | Rule has been in preview since 0.15.3 |
D421 |
property-docstring-starts-with-verbProperty docstring should not start with a verb ("{first_word}") |
pedantic | pydocstyle | Rule has been in preview since 0.15.18 |
F401 |
unused-import{name} imported but unused; consider using importlib.util.find_spec to test for availability |
suspicious | Pyflakes | Rule has been stable since v0.0.18Automatic fix availableEnabled by default |
F402 |
import-shadowed-by-loop-varImport {name} from {row} shadowed by loop variable |
suspicious | Pyflakes | Rule has been stable since v0.0.44Enabled by default |
F403 |
undefined-local-with-import-starfrom {name} import * used; unable to detect undefined names |
restriction | Pyflakes | Rule has been stable since v0.0.18 |
F404 |
late-future-importfrom __future__ imports must occur at the beginning of the file |
correctness | Pyflakes | Rule has been stable since v0.0.34Enabled by default |
F405 |
undefined-local-with-import-star-usage{name} may be undefined, or defined from star imports |
restriction | Pyflakes | Rule has been stable since v0.0.44 |
F406 |
undefined-local-with-nested-import-star-usagefrom {name} import * only allowed at module level |
correctness | Pyflakes | Rule has been stable since v0.0.37 |
F407 |
future-feature-not-definedFuture feature {name} is not defined |
correctness | Pyflakes | Rule has been stable since v0.0.34Enabled by default |
F501 |
percent-format-invalid-format%-format string has invalid format string: {message} |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F502 |
percent-format-expected-mapping%-format string expected mapping but got sequence |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F503 |
percent-format-expected-sequence%-format string expected sequence but got mapping |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F504 |
percent-format-extra-named-arguments%-format string has unused named argument(s): {message} |
correctness | Pyflakes | Rule has been stable since v0.0.142Automatic fix availableEnabled by default |
F505 |
percent-format-missing-argument%-format string is missing argument(s) for placeholder(s): {message} |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F506 |
percent-format-mixed-positional-and-named%-format string has mixed positional and named placeholders |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F507 |
percent-format-positional-count-mismatch%-format string has {wanted} placeholder(s) but {got} substitution(s) |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F508 |
percent-format-star-requires-sequence%-format string * specifier requires sequence |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F509 |
percent-format-unsupported-format-character%-format string has unsupported format character {char} |
correctness | Pyflakes | Rule has been stable since v0.0.142Enabled by default |
F521 |
string-dot-format-invalid-format.format call has invalid format string: {message} |
correctness | Pyflakes | Rule has been stable since v0.0.138Enabled by default |
F522 |
string-dot-format-extra-named-arguments.format call has unused named argument(s): {message} |
correctness | Pyflakes | Rule has been stable since v0.0.139Automatic fix availableEnabled by default |
F523 |
string-dot-format-extra-positional-arguments.format call has unused arguments at position(s): {message} |
correctness | Pyflakes | Rule has been stable since v0.0.139Automatic fix availableEnabled by default |
F524 |
string-dot-format-missing-arguments.format call is missing argument(s) for placeholder(s): {message} |
correctness | Pyflakes | Rule has been stable since v0.0.139Enabled by default |
F525 |
string-dot-format-mixing-automatic.format string mixes automatic and manual numbering |
correctness | Pyflakes | Rule has been stable since v0.0.139Enabled by default |
F541 |
f-string-missing-placeholdersf-string without any placeholders |
complexity | Pyflakes | Rule has been stable since v0.0.18Automatic fix availableEnabled by default |
F601 |
multi-value-repeated-key-literalDictionary key literal {name} repeated |
correctness | Pyflakes | Rule has been stable since v0.0.30Automatic fix availableEnabled by default |
F602 |
multi-value-repeated-key-variableDictionary key {name} repeated |
correctness | Pyflakes | Rule has been stable since v0.0.30Automatic fix availableEnabled by default |
F621 |
expressions-in-star-assignmentToo many expressions in star-unpacking assignment |
correctness | Pyflakes | Rule has been stable since v0.0.32Enabled by default |
F622 |
multiple-starred-expressionsTwo starred expressions in assignment |
correctness | Pyflakes | Rule has been stable since v0.0.32Enabled by default |
F631 |
assert-tupleAssert test is a non-empty tuple, which is always True |
correctness | Pyflakes | Rule has been stable since v0.0.28Enabled by default |
F632 |
is-literalUse == to compare constant literals |
suspicious | Pyflakes | Rule has been stable since v0.0.39Automatic fix availableEnabled by default |
F633 |
invalid-print-syntaxUse of >> is invalid with print function |
correctness | Pyflakes | Rule has been stable since v0.0.39Enabled by default |
F634 |
if-tupleIf test is a tuple, which is always True |
correctness | Pyflakes | Rule has been stable since v0.0.18Enabled by default |
F701 |
break-outside-loopbreak outside loop |
correctness | Pyflakes | Rule has been stable since v0.0.36Enabled by default |
F702 |
continue-outside-loopcontinue not properly in loop |
correctness | Pyflakes | Rule has been stable since v0.0.36Enabled by default |
F704 |
yield-outside-function{keyword} statement outside of a function |
correctness | Pyflakes | Rule has been stable since v0.0.22Enabled by default |
F706 |
return-outside-functionreturn statement outside of a function/method |
correctness | Pyflakes | Rule has been stable since v0.0.18Enabled by default |
F707 |
default-except-not-lastAn except block as not the last exception handler |
correctness | Pyflakes | Rule has been stable since v0.0.28Enabled by default |
F722 |
forward-annotation-syntax-errorSyntax error in forward annotation: {parse_error} |
pedantic | Pyflakes | Rule has been stable since v0.0.39 |
F811 |
redefined-while-unusedRedefinition of unused {name} from {row} |
suspicious | Pyflakes | Rule has been stable since v0.0.171Automatic fix availableEnabled by default |
F821 |
undefined-nameUndefined name {name}. {tip} |
correctness | Pyflakes | Rule has been stable since v0.0.20Enabled by default |
F822 |
undefined-exportUndefined name {name} in __all__ |
suspicious | Pyflakes | Rule has been stable since v0.0.25Enabled by default |
F823 |
undefined-localLocal variable {name} referenced before assignment |
correctness | Pyflakes | Rule has been stable since v0.0.24Enabled by default |
F841 |
unused-variableLocal variable {name} is assigned to but never used |
correctness | Pyflakes | Rule has been stable since v0.0.22Automatic fix availableEnabled by default |
F842 |
unused-annotationLocal variable {name} is annotated but never used |
correctness | Pyflakes | Rule has been stable since v0.0.172Enabled by default |
F901 |
raise-not-implementedraise NotImplemented should be raise NotImplementedError |
correctness | Pyflakes | Rule has been stable since v0.0.18Automatic fix availableEnabled by default |
PGH001 |
evalNo builtin eval() allowed |
security | pygrep-hooks | Rule was removed in v0.2.0 |
PGH002 |
deprecated-log-warnwarn is deprecated in favor of warning |
suspicious | pygrep-hooks | Rule was removed in v0.2.0Automatic fix available |
PGH003 |
blanket-type-ignoreUse specific rule codes when ignoring type issues |
restriction | pygrep-hooks | Rule has been stable since v0.0.187 |
PGH004 |
blanket-noqaUse specific rule codes when using noqa |
pedantic | pygrep-hooks | Rule has been stable since v0.0.200Automatic fix available |
PGH005 |
invalid-mock-accessMock method should be called: {name} |
suspicious | pygrep-hooks | Rule has been stable since v0.0.266Enabled by default |
PLC0105 |
type-name-incorrect-variance{kind} name "{param_name}" does not reflect its {variance}; consider renaming it to "{replacement_name}" |
style | Pylint | Rule has been stable since v0.0.278Enabled by default |
PLC0131 |
type-bivariance{kind} cannot be both covariant and contravariant |
correctness | Pylint | Rule has been stable since v0.0.278Enabled by default |
PLC0132 |
type-param-name-mismatch{kind} name {param_name} does not match assigned variable name {var_name} |
suspicious | Pylint | Rule has been stable since v0.0.277Enabled by default |
PLC0205 |
single-string-slotsClass __slots__ should be a non-string iterable |
suspicious | Pylint | Rule has been stable since v0.0.276Enabled by default |
PLC0206 |
dict-index-missing-itemsExtracting value from dictionary without calling .items() |
complexity | Pylint | Rule has been stable since 0.8.0Enabled by default |
PLC0207 |
missing-maxsplit-argString is split more times than necessary |
performance | Pylint | Rule has been stable since 0.15.0Automatic fix available |
PLC0208 |
iteration-over-setUse a sequence type instead of a set when iterating over values |
performance | Pylint | Rule has been stable since v0.0.271Automatic fix availableEnabled by default |
PLC0414 |
useless-import-aliasImport alias does not rename original package |
complexity | Pylint | Rule has been stable since v0.0.156Automatic fix availableEnabled by default |
PLC0415 |
import-outside-top-levelimport should be at the top-level of a file |
pedantic | Pylint | Rule has been stable since 0.12.0 |
PLC1802 |
len-testlen({expression}) used as condition without comparison |
pedantic | Pylint | Rule has been stable since 0.10.0Automatic fix available |
PLC1901 |
compare-to-empty-string{existing} can be simplified to {replacement} as an empty string is falsey |
pedantic | Pylint | Rule has been in preview since v0.0.255 |
PLC2401 |
non-ascii-name{kind} name {name} contains a non-ASCII character |
pedantic | Pylint | Rule has been stable since 0.5.0 |
PLC2403 |
non-ascii-import-nameModule alias {name} contains a non-ASCII character |
pedantic | Pylint | Rule has been stable since 0.5.0 |
PLC2701 |
import-private-namePrivate name import {name} from external module {module} |
pedantic | Pylint | Rule has been in preview since v0.1.14 |
PLC2801 |
unnecessary-dunder-callUnnecessary dunder call to {method}. {replacement}. |
complexity | Pylint | Rule has been in preview since v0.1.12Automatic fix available |
PLC3002 |
unnecessary-direct-lambda-callLambda expression called directly. Execute the expression inline instead. |
complexity | Pylint | Rule has been stable since v0.0.153Enabled by default |
PLE0100 |
yield-in-init__init__ method is a generator |
correctness | Pylint | Rule has been stable since v0.0.245Enabled by default |
PLE0101 |
return-in-initExplicit return in __init__ |
correctness | Pylint | Rule has been stable since v0.0.248Enabled by default |
PLE0115 |
nonlocal-and-globalName {name} is both nonlocal and global |
correctness | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLE0116 |
continue-in-finallycontinue not supported inside finally clause |
correctness | Pylint | Rule has been stable since v0.0.257Enabled by default |
PLE0117 |
nonlocal-without-bindingNonlocal name {name} found without binding |
correctness | Pylint | Rule has been stable since v0.0.174Enabled by default |
PLE0118 |
load-before-global-declarationName {name} is used prior to global declaration on {row} |
correctness | Pylint | Rule has been stable since v0.0.174Enabled by default |
PLE0237 |
non-slot-assignmentAttribute {name} is not defined in class's __slots__ |
pedantic | Pylint | Rule has been stable since v0.1.15 |
PLE0241 |
duplicate-basesDuplicate base {base} for class {class} |
correctness | Pylint | Rule has been stable since v0.0.269Automatic fix available |
PLE0302 |
unexpected-special-method-signatureThe special method {} expects {}, {} {} given |
pedantic | Pylint | Rule has been stable since v0.0.263 |
PLE0303 |
invalid-length-return-type__len__ does not return a non-negative integer |
suspicious | Pylint | Rule has been stable since 0.6.0Enabled by default |
PLE0304 |
invalid-bool-return-type__bool__ does not return bool |
suspicious | Pylint | Rule has been stable since 0.16.0Enabled by default |
PLE0305 |
invalid-index-return-type__index__ does not return an integer |
suspicious | Pylint | Rule has been stable since 0.6.0Enabled by default |
PLE0307 |
invalid-str-return-type__str__ does not return str |
suspicious | Pylint | Rule has been stable since v0.0.271Enabled by default |
PLE0308 |
invalid-bytes-return-type__bytes__ does not return bytes |
suspicious | Pylint | Rule has been stable since 0.6.0Enabled by default |
PLE0309 |
invalid-hash-return-type__hash__ does not return an integer |
suspicious | Pylint | Rule has been stable since 0.6.0Enabled by default |
PLE0604 |
invalid-all-objectInvalid object in __all__, must contain only strings |
correctness | Pylint | Rule has been stable since v0.0.237Enabled by default |
PLE0605 |
invalid-all-formatInvalid format for __all__, must be tuple or list |
correctness | Pylint | Rule has been stable since v0.0.237Enabled by default |
PLE0643 |
potential-index-errorExpression is likely to raise IndexError |
correctness | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLE0704 |
misplaced-bare-raiseBare raise statement is not inside an exception handler |
suspicious | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLE1132 |
repeated-keyword-argumentRepeated keyword argument: {duplicate_keyword} |
correctness | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLE1141 |
dict-iter-missing-itemsUnpacking a dictionary in iteration without calling .items() |
suspicious | Pylint | Rule has been in preview since v0.3.0Automatic fix available |
PLE1142 |
await-outside-asyncawait should be used within an async function |
correctness | Pylint | Rule has been stable since v0.0.150Enabled by default |
PLE1205 |
logging-too-many-argsToo many arguments for logging format string |
correctness | Pylint | Rule has been stable since v0.0.252Enabled by default |
PLE1206 |
logging-too-few-argsNot enough arguments for logging format string |
correctness | Pylint | Rule has been stable since v0.0.252Enabled by default |
PLE1300 |
bad-string-format-characterUnsupported format character '{format_char}' |
correctness | Pylint | Rule has been stable since v0.0.283Enabled by default |
PLE1307 |
bad-string-format-typeFormat type does not match argument type |
correctness | Pylint | Rule has been stable since v0.0.245Enabled by default |
PLE1310 |
bad-str-strip-callString {strip} call contains duplicate characters (did you mean {removal}?) |
correctness | Pylint | Rule has been stable since v0.0.242Enabled by default |
PLE1507 |
invalid-envvar-valueInvalid type for initial os.getenv argument; expected str |
correctness | Pylint | Rule has been stable since v0.0.255Enabled by default |
PLE1519 |
singledispatch-method@singledispatch decorator should not be used on methods |
suspicious | Pylint | Rule has been stable since 0.6.0Automatic fix availableEnabled by default |
PLE1520 |
singledispatchmethod-function@singledispatchmethod decorator should not be used on non-method functions |
suspicious | Pylint | Rule has been stable since 0.6.0Automatic fix availableEnabled by default |
PLE1700 |
yield-from-in-async-functionyield from statement in async function; use async for instead |
correctness | Pylint | Rule has been stable since v0.0.271Enabled by default |
PLE2502 |
bidirectional-unicodeContains control characters that can permit obfuscated code |
suspicious | Pylint | Rule has been stable since v0.0.244Enabled by default |
PLE2510 |
invalid-character-backspaceInvalid unescaped character backspace, use "\b" instead |
suspicious | Pylint | Rule has been stable since v0.0.257Automatic fix availableEnabled by default |
PLE2512 |
invalid-character-subInvalid unescaped character SUB, use "\x1a" instead |
suspicious | Pylint | Rule has been stable since v0.0.257Automatic fix availableEnabled by default |
PLE2513 |
invalid-character-escInvalid unescaped character ESC, use "\x1b" instead |
suspicious | Pylint | Rule has been stable since v0.0.257Automatic fix availableEnabled by default |
PLE2514 |
invalid-character-nulInvalid unescaped character NUL, use "\0" instead |
suspicious | Pylint | Rule has been stable since v0.0.257Automatic fix availableEnabled by default |
PLE2515 |
invalid-character-zero-width-spaceInvalid unescaped character zero-width-space, use "\u200B" instead |
suspicious | Pylint | Rule has been stable since v0.0.257Automatic fix availableEnabled by default |
PLE4703 |
modified-iterating-setIterated set {name} is modified within the for loop |
suspicious | Pylint | Rule has been in preview since v0.3.5Automatic fix available |
PLR0124 |
comparison-with-itselfName compared with itself, consider replacing {actual} |
suspicious | Pylint | Rule has been stable since v0.0.273Enabled by default |
PLR0133 |
comparison-of-constantTwo constants compared in a comparison, consider replacing {left_constant} {op} {right_constant} |
complexity | Pylint | Rule has been stable since v0.0.221Enabled by default |
PLR0202 |
no-classmethod-decoratorClass method defined without decorator |
style | Pylint | Rule has been in preview since v0.1.7Automatic fix available |
PLR0203 |
no-staticmethod-decoratorStatic method defined without decorator |
style | Pylint | Rule has been in preview since v0.1.7Automatic fix available |
PLR0206 |
property-with-parametersCannot have defined parameters for properties |
correctness | Pylint | Rule has been stable since v0.0.153Enabled by default |
PLR0402 |
manual-from-importUse from {module} import {name} in lieu of alias |
complexity | Pylint | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
PLR0904 |
too-many-public-methodsToo many public methods ({methods} > {max_methods}) |
pedantic | Pylint | Rule has been in preview since v0.0.290 |
PLR0911 |
too-many-return-statementsToo many return statements ({returns} > {max_returns}) |
pedantic | Pylint | Rule has been stable since v0.0.242 |
PLR0912 |
too-many-branchesToo many branches ({branches} > {max_branches}) |
pedantic | Pylint | Rule has been stable since v0.0.242 |
PLR0913 |
too-many-argumentsToo many arguments in function definition ({c_args} > {max_args}) |
pedantic | Pylint | Rule has been stable since v0.0.238 |
PLR0914 |
too-many-localsToo many local variables ({current_amount} > {max_amount}) |
pedantic | Pylint | Rule has been in preview since v0.1.9 |
PLR0915 |
too-many-statementsToo many statements ({statements} > {max_statements}) |
pedantic | Pylint | Rule has been stable since v0.0.240 |
PLR0916 |
too-many-boolean-expressionsToo many Boolean expressions ({expressions} > {max_expressions}) |
pedantic | Pylint | Rule has been in preview since v0.1.1 |
PLR0917 |
too-many-positional-argumentsToo many positional arguments ({c_pos} > {max_pos}) |
pedantic | Pylint | Rule has been stable since 0.16.0 |
PLR1701 |
repeated-isinstance-callsMerge isinstance calls: {expression} |
complexity | Pylint | Rule was removed in 0.5.0Automatic fix available |
PLR1702 |
too-many-nested-blocksToo many nested blocks ({nested_blocks} > {max_nested_blocks}) |
pedantic | Pylint | Rule has been in preview since v0.1.15 |
PLR1704 |
redefined-argument-from-localRedefining argument with the local name {name} |
suspicious | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLR1706 |
and-or-ternaryConsider using if-else expression |
pedantic | Pylint | Rule was removed in v0.2.0 |
PLR1708 |
stop-iteration-returnExplicit raise StopIteration in generator |
correctness | Pylint | Rule has been stable since 0.16.0Enabled by default |
PLR1711 |
useless-returnUseless return statement at end of function |
complexity | Pylint | Rule has been stable since v0.0.257Automatic fix availableEnabled by default |
PLR1712 |
swap-with-temporary-variableUnnecessary temporary variable |
complexity | Pylint | Rule has been in preview since 0.15.3Automatic fix available |
PLR1714 |
repeated-equality-comparisonConsider merging multiple comparisons: {expression}. Use a set if the elements are hashable. |
pedantic | Pylint | Rule has been stable since v0.0.279Automatic fix available |
PLR1716 |
boolean-chained-comparisonContains chained boolean comparison that can be simplified |
style | Pylint | Rule has been stable since 0.9.0Automatic fix availableEnabled by default |
PLR1722 |
sys-exit-aliasUse sys.exit() instead of {name} |
suspicious | Pylint | Rule has been stable since v0.0.156Automatic fix availableEnabled by default |
PLR1730 |
if-stmt-min-maxReplace if statement with {replacement} |
complexity | Pylint | Rule has been stable since 0.6.0Automatic fix availableEnabled by default |
PLR1733 |
unnecessary-dict-index-lookupUnnecessary lookup of dictionary value by key |
complexity | Pylint | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
PLR1736 |
unnecessary-list-index-lookupList index lookup in enumerate() loop |
complexity | Pylint | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
PLR2004 |
magic-value-comparisonMagic value used in comparison, consider replacing {value} with a constant variable |
pedantic | Pylint | Rule has been stable since v0.0.221 |
PLR2044 |
empty-commentLine with empty comment |
style | Pylint | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
PLR5501 |
collapsible-else-ifUse elif instead of else then if, to reduce indentation |
pedantic | Pylint | Rule has been stable since v0.0.253Automatic fix available |
PLR6104 |
non-augmented-assignmentUse {operator} to perform an augmented assignment directly |
pedantic | Pylint | Rule has been in preview since v0.3.7Automatic fix available |
PLR6201 |
literal-membershipUse a set literal when testing for membership |
pedantic | Pylint | Rule has been in preview since v0.1.1Automatic fix available |
PLR6301 |
no-self-useMethod {method_name} could be a function, class method, or static method |
pedantic | Pylint | Rule has been in preview since v0.0.286 |
PLW0108 |
unnecessary-lambdaLambda may be unnecessary; consider inlining inner function |
style | Pylint | Rule has been stable since 0.15.0Automatic fix available |
PLW0120 |
useless-else-on-loopelse clause on loop without a break statement; remove the else and dedent its contents |
suspicious | Pylint | Rule has been stable since v0.0.156Automatic fix availableEnabled by default |
PLW0127 |
self-assigning-variableSelf-assignment of variable {name} |
suspicious | Pylint | Rule has been stable since v0.0.281Enabled by default |
PLW0128 |
redeclared-assigned-nameRedeclared variable {name} in assignment |
correctness | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLW0129 |
assert-on-string-literalAsserting on an empty string literal will never pass |
correctness | Pylint | Rule has been stable since v0.0.258Enabled by default |
PLW0131 |
named-expr-without-contextNamed expression used without context |
complexity | Pylint | Rule has been stable since v0.0.270Enabled by default |
PLW0133 |
useless-exception-statementMissing raise statement on exception |
correctness | Pylint | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
PLW0177 |
nan-comparisonComparing against a NaN value; use math.isnan instead |
correctness | Pylint | Rule has been stable since 0.12.0Enabled by default |
PLW0211 |
bad-staticmethod-argumentFirst argument of a static method should not be named {argument_name} |
suspicious | Pylint | Rule has been stable since 0.6.0Enabled by default |
PLW0244 |
redefined-slots-in-subclassSlot {slot_name} redefined from base class {base} |
correctness | Pylint | Rule has been in preview since 0.9.3 |
PLW0245 |
super-without-bracketssuper call is missing parentheses |
correctness | Pylint | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
PLW0406 |
import-selfModule {name} imports itself |
suspicious | Pylint | Rule has been stable since v0.0.265Enabled by default |
PLW0602 |
global-variable-not-assignedUsing global for {name} but no assignment is done |
style | Pylint | Rule has been stable since v0.0.174Enabled by default |
PLW0603 |
global-statementUsing the global statement to update {name} is discouraged |
restriction | Pylint | Rule has been stable since v0.0.253 |
PLW0604 |
global-at-module-levelglobal at module level is redundant |
correctness | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLW0642 |
self-or-cls-assignmentReassigned {} variable in {method_type} method |
suspicious | Pylint | Rule has been stable since 0.6.0Enabled by default |
PLW0711 |
binary-op-exceptionException to catch is the result of a binary and operation |
suspicious | Pylint | Rule has been stable since v0.0.258Enabled by default |
PLW0717 |
too-many-statements-in-try-clauseTry clause contains too many statements ({statements} > {max_statements}) |
pedantic | Pylint | Rule has been in preview since 0.15.14 |
PLW1501 |
bad-open-mode{mode} is not a valid mode for open |
correctness | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLW1507 |
shallow-copy-environShallow copy of os.environ via copy.copy(os.environ) |
correctness | Pylint | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
PLW1508 |
invalid-envvar-defaultInvalid type for environment variable default; expected str or None |
suspicious | Pylint | Rule has been stable since v0.0.255Enabled by default |
PLW1509 |
subprocess-popen-preexec-fnpreexec_fn argument is unsafe when using threads |
suspicious | Pylint | Rule has been stable since v0.0.281Enabled by default |
PLW1510 |
subprocess-run-without-checksubprocess.run without explicit check argument |
suspicious | Pylint | Rule has been stable since v0.0.285Automatic fix availableEnabled by default |
PLW1514 |
unspecified-encoding{function_name} in text mode without explicit encoding argument |
pedantic | Pylint | Rule has been in preview since v0.1.1Automatic fix available |
PLW1641 |
eq-without-hashObject does not implement __hash__ method |
pedantic | Pylint | Rule has been stable since 0.12.0 |
PLW2101 |
useless-with-lockThreading lock directly created in with statement has no effect |
correctness | Pylint | Rule has been stable since 0.5.0Enabled by default |
PLW2901 |
redefined-loop-nameOuter {outer_kind} variable {name} overwritten by inner {inner_kind} target |
pedantic | Pylint | Rule has been stable since v0.0.252 |
PLW3201 |
bad-dunder-method-nameDunder method {name} has no special meaning in Python 3 |
pedantic | Pylint | Rule has been in preview since v0.0.285 |
PLW3301 |
nested-min-maxNested {func} calls can be flattened |
pedantic | Pylint | Rule has been stable since v0.0.266Automatic fix available |
UP001 |
useless-metaclass-type__metaclass__ = type is implied |
style | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP003 |
type-of-primitiveUse {} instead of type(...) |
style | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP004 |
useless-object-inheritanceClass {name} inherits from object |
complexity | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP005 |
deprecated-unittest-alias{alias} is deprecated, use {target} |
suspicious | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP006 |
non-pep585-annotationUse {to} instead of {from} for type annotation |
suspicious | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP007 |
non-pep604-annotation-unionUse X | Y for type annotations |
style | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP008 |
super-call-with-parametersUse super() instead of super(__class__, self) |
style | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP009 |
utf8-encoding-declarationUTF-8 encoding declaration is unnecessary |
complexity | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP010 |
unnecessary-future-importUnnecessary __future__ import {import} for target Python version |
complexity | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP011 |
lru-cache-without-parametersUnnecessary parentheses to functools.lru_cache |
style | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP012 |
unnecessary-encode-utf8Unnecessary call to encode as UTF-8 |
complexity | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP013 |
convert-typed-dict-functional-to-classConvert {name} from TypedDict functional to class syntax |
pedantic | pyupgrade | Rule has been stable since v0.0.155Automatic fix available |
UP014 |
convert-named-tuple-functional-to-classConvert {name} from NamedTuple functional to class syntax |
style | pyupgrade | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
UP015 |
redundant-open-modesUnnecessary mode argument |
pedantic | pyupgrade | Rule has been stable since v0.0.155Automatic fix available |
UP017 |
datetime-timezone-utcUse datetime.UTC alias |
style | pyupgrade | Rule has been stable since v0.0.192Automatic fix availableEnabled by default |
UP018 |
native-literalsUnnecessary {literal_type} call (rewrite as a literal) |
style | pyupgrade | Rule has been stable since v0.0.193Automatic fix availableEnabled by default |
UP019 |
typing-text-str-alias{}.Text is deprecated, use str |
suspicious | pyupgrade | Rule has been stable since v0.0.195Automatic fix availableEnabled by default |
UP020 |
open-aliasUse builtin open |
style | pyupgrade | Rule has been stable since v0.0.196Automatic fix availableEnabled by default |
UP021 |
replace-universal-newlinesuniversal_newlines is deprecated, use text |
style | pyupgrade | Rule has been stable since v0.0.196Automatic fix availableEnabled by default |
UP022 |
replace-stdout-stderrPrefer capture_output over sending stdout and stderr to PIPE |
complexity | pyupgrade | Rule has been stable since v0.0.199Automatic fix availableEnabled by default |
UP023 |
deprecated-c-element-treecElementTree is deprecated, use ElementTree |
suspicious | pyupgrade | Rule has been stable since v0.0.199Automatic fix availableEnabled by default |
UP024 |
os-error-aliasReplace aliased errors with OSError |
suspicious | pyupgrade | Rule has been stable since v0.0.206Automatic fix availableEnabled by default |
UP025 |
unicode-kind-prefixRemove unicode literals from strings |
complexity | pyupgrade | Rule has been stable since v0.0.201Automatic fix availableEnabled by default |
UP026 |
deprecated-mock-importmock is deprecated, use unittest.mock |
suspicious | pyupgrade | Rule has been stable since v0.0.206Automatic fix availableEnabled by default |
UP027 |
unpacked-list-comprehensionReplace unpacked list comprehension with a generator expression |
pedantic | pyupgrade | Rule was removed in 0.8.0 |
UP028 |
yield-in-for-loopReplace yield over for loop with yield from |
style | pyupgrade | Rule has been stable since v0.0.210Automatic fix availableEnabled by default |
UP029 |
unnecessary-builtin-importUnnecessary builtin import: {import} |
suspicious | pyupgrade | Rule has been stable since v0.0.211Automatic fix availableEnabled by default |
UP030 |
format-literalsUse implicit references for positional format fields |
complexity | pyupgrade | Rule has been stable since v0.0.218Automatic fix availableEnabled by default |
UP031 |
printf-string-formattingUse format specifiers instead of percent format |
style | pyupgrade | Rule has been stable since v0.0.229Automatic fix availableEnabled by default |
UP032 |
f-stringUse f-string instead of format call |
complexity | pyupgrade | Rule has been stable since v0.0.224Automatic fix availableEnabled by default |
UP033 |
lru-cache-with-maxsize-noneUse @functools.cache instead of @functools.lru_cache(maxsize=None) |
style | pyupgrade | Rule has been stable since v0.0.225Automatic fix availableEnabled by default |
UP034 |
extraneous-parenthesesAvoid extraneous parentheses |
complexity | pyupgrade | Rule has been stable since v0.0.228Automatic fix availableEnabled by default |
UP035 |
deprecated-importImport from {target} instead: {names} |
suspicious | pyupgrade | Rule has been stable since v0.0.239Automatic fix availableEnabled by default |
UP036 |
outdated-version-blockVersion block is outdated for minimum Python version |
suspicious | pyupgrade | Rule has been stable since v0.0.240Automatic fix availableEnabled by default |
UP037 |
quoted-annotationRemove quotes from type annotation |
correctness | pyupgrade | Rule has been stable since v0.0.242Automatic fix availableEnabled by default |
UP038 |
non-pep604-isinstanceUse X | Y in {} call instead of (X, Y) |
pedantic | pyupgrade | Rule was removed in 0.13.0Automatic fix available |
UP039 |
unnecessary-class-parenthesesUnnecessary parentheses after class definition |
style | pyupgrade | Rule has been stable since v0.0.273Automatic fix availableEnabled by default |
UP040 |
non-pep695-type-aliasType alias {name} uses {type_alias_method} instead of the type keyword |
complexity | pyupgrade | Rule has been stable since v0.0.283Automatic fix availableEnabled by default |
UP041 |
timeout-error-aliasReplace aliased errors with TimeoutError |
suspicious | pyupgrade | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
UP042 |
replace-str-enumClass {name} inherits from both str and enum.Enum |
suspicious | pyupgrade | Rule has been stable since 0.15.0Automatic fix available |
UP043 |
unnecessary-default-type-argsUnnecessary default type arguments |
complexity | pyupgrade | Rule has been stable since 0.8.0Automatic fix availableEnabled by default |
UP044 |
non-pep646-unpackUse * for unpacking |
complexity | pyupgrade | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
UP045 |
non-pep604-annotation-optionalUse X | None for type annotations |
style | pyupgrade | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
UP046 |
non-pep695-generic-classGeneric class {name} uses Generic subclass instead of type parameters |
complexity | pyupgrade | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
UP047 |
non-pep695-generic-functionGeneric function {name} should use type parameters |
complexity | pyupgrade | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
UP048 |
while-oneUse while True: instead of while 1: |
style | pyupgrade | Rule has been in preview since 0.16.3Automatic fix available |
UP049 |
private-type-parameterGeneric {} uses private type parameters |
style | pyupgrade | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
UP050 |
useless-class-metaclass-typeClass {name} uses metaclass=type, which is redundant |
correctness | pyupgrade | Rule has been stable since 0.13.0Automatic fix availableEnabled by default |
UP051 |
deprecated-abc-decoratorUse @{to} and @abstractmethod instead of {from} |
suspicious | pyupgrade | Rule has been in preview since 0.15.21Automatic fix available |
FURB101 |
read-whole-filePath.open() followed by read() can be replaced by {filename}.{suggestion} |
pedantic | refurb | Rule has been in preview since v0.1.2Automatic fix available |
FURB103 |
write-whole-filePath.open() followed by write() can be replaced by {filename}.{suggestion} |
pedantic | refurb | Rule has been in preview since v0.3.6Automatic fix available |
FURB105 |
print-empty-stringUnnecessary empty string passed to print |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB110 |
if-exp-instead-of-or-operatorReplace ternary if expression with or operator |
complexity | refurb | Rule has been stable since 0.15.0Automatic fix available |
FURB113 |
repeated-appendUse {suggestion} instead of repeatedly calling {name}.append() |
performance | refurb | Rule has been in preview since v0.0.287Automatic fix available |
FURB116 |
f-string-number-formatReplace {function_name} call with {display} |
pedantic | refurb | Rule has been stable since 0.13.0Automatic fix available |
FURB118 |
reimplemented-operatorUse operator.{operator} instead of defining a {target} |
pedantic | refurb | Rule has been in preview since v0.1.9Automatic fix available |
FURB122 |
for-loop-writesUse of {}.write in a for loop |
complexity | refurb | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
FURB129 |
readlines-in-forInstead of calling readlines(), iterate over file object directly |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB131 |
delete-full-slicePrefer clear over deleting a full slice |
complexity | refurb | Rule has been in preview since v0.0.287Automatic fix available |
FURB132 |
check-and-remove-from-setUse {suggestion} instead of check and remove |
complexity | refurb | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
FURB136 |
if-expr-min-maxReplace if expression with {min_max} call |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB140 |
reimplemented-starmapUse itertools.starmap instead of the generator |
pedantic | refurb | Rule has been in preview since v0.0.291Automatic fix available |
FURB142 |
for-loop-set-mutationsUse of set.{}() in a for loop |
complexity | refurb | Rule has been in preview since v0.3.5Automatic fix available |
FURB145 |
slice-copyPrefer copy method over slicing |
style | refurb | Rule has been in preview since v0.0.290Automatic fix available |
FURB148 |
unnecessary-enumerateenumerate value is unused, use for x in range(len(y)) instead |
complexity | refurb | Rule has been in preview since v0.0.291Automatic fix available |
FURB152 |
math-constantReplace {literal} with math.{constant} |
correctness | refurb | Rule has been in preview since v0.1.6Automatic fix available |
FURB154 |
repeated-globalUse of repeated consecutive {} |
formatting | refurb | Rule has been in preview since v0.4.9Automatic fix available |
FURB156 |
hardcoded-string-charsetUse of hardcoded string charset |
complexity | refurb | Rule has been in preview since 0.7.0Automatic fix available |
FURB157 |
verbose-decimal-constructorVerbose expression in Decimal constructor |
complexity | refurb | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
FURB161 |
bit-countUse of bin({existing}).count('1') |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB162 |
fromisoformat-replace-zUnnecessary timezone replacement with zero offset |
complexity | refurb | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
FURB163 |
redundant-log-basePrefer math.{log_function}({arg}) over math.log with a redundant base |
correctness | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB164 |
unnecessary-from-floatVerbose method {method_name} in {constructor} construction |
pedantic | refurb | Rule has been stable since 0.16.0Automatic fix available |
FURB166 |
int-on-sliced-strUse of int with explicit base={base} after removing prefix |
complexity | refurb | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
FURB167 |
regex-flag-aliasUse of regular expression alias re.{} |
style | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB168 |
isinstance-type-nonePrefer is operator over isinstance to check if an object is None |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB169 |
type-none-comparisonWhen checking against None, use {} instead of comparison with type(None) |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB171 |
single-item-membership-testMembership test against single-item container |
complexity | refurb | Rule has been stable since 0.15.0Automatic fix available |
FURB177 |
implicit-cwdPrefer Path.cwd() over Path().resolve() for current-directory lookups |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB180 |
meta-class-abc-metaUse of metaclass=abc.ABCMeta to define abstract base class |
complexity | refurb | Rule has been in preview since v0.2.0Automatic fix available |
FURB181 |
hashlib-digest-hexUse of hashlib's .digest().hex() |
complexity | refurb | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
FURB187 |
list-reverse-copyUse of assignment of reversed on list {name} |
pedantic | refurb | Rule has been stable since 0.5.0Automatic fix available |
FURB188 |
slice-to-remove-prefix-or-suffixPrefer str.removeprefix() over conditionally replacing with slice. |
complexity | refurb | Rule has been stable since 0.9.0Automatic fix availableEnabled by default |
FURB189 |
subclass-builtinSubclassing {subclass} can be error prone, use collections.{replacement} instead |
suspicious | refurb | Rule has been in preview since 0.7.3Automatic fix available |
FURB192 |
sorted-min-maxPrefer min over sorted() to compute the minimum value in a sequence |
complexity | refurb | Rule has been stable since 0.16.0Automatic fix availableEnabled by default |
RUF001 |
ambiguous-unicode-character-stringString contains ambiguous {}. Did you mean {}? |
security | Ruff | Rule has been stable since v0.0.102 |
RUF002 |
ambiguous-unicode-character-docstringDocstring contains ambiguous {}. Did you mean {}? |
security | Ruff | Rule has been stable since v0.0.102 |
RUF003 |
ambiguous-unicode-character-commentComment contains ambiguous {}. Did you mean {}? |
security | Ruff | Rule has been stable since v0.0.108 |
RUF005 |
collection-literal-concatenationConsider {expression} instead of concatenation |
pedantic | Ruff | Rule has been stable since v0.0.227Automatic fix available |
RUF006 |
asyncio-dangling-taskStore a reference to the return value of {expr}.{method} |
pedantic | Ruff | Rule has been stable since v0.0.247 |
RUF007 |
zip-instead-of-pairwisePrefer itertools.pairwise() over zip() when iterating over successive pairs |
complexity | Ruff | Rule has been stable since v0.0.257Automatic fix availableEnabled by default |
RUF008 |
mutable-dataclass-defaultDo not use mutable default values for dataclass attributes |
suspicious | Ruff | Rule has been stable since v0.0.262Enabled by default |
RUF009 |
function-call-in-dataclass-default-argumentDo not perform function call {name} in dataclass defaults |
suspicious | Ruff | Rule has been stable since v0.0.262Enabled by default |
RUF010 |
explicit-f-string-type-conversionUse explicit conversion flag |
complexity | Ruff | Rule has been stable since v0.0.267Automatic fix availableEnabled by default |
RUF011 |
ruff-static-key-dict-comprehensionDictionary comprehension uses static key |
correctness | Ruff | Rule was removed in v0.2.0 |
RUF012 |
mutable-class-defaultMutable default value for class attribute |
suspicious | Ruff | Rule has been stable since v0.0.273Enabled by default |
RUF013 |
implicit-optionalPEP 484 prohibits implicit Optional |
suspicious | Ruff | Rule has been stable since v0.0.273Automatic fix availableEnabled by default |
RUF015 |
unnecessary-iterable-allocation-for-first-elementPrefer next({iterable}) over single element slice |
performance | Ruff | Rule has been stable since v0.0.278Automatic fix availableEnabled by default |
RUF016 |
invalid-index-typeSlice in indexed access to type {value_type} uses type {index_type} instead of an integer |
correctness | Ruff | Rule has been stable since v0.0.278Enabled by default |
RUF017 |
quadratic-list-summationAvoid quadratic list summation |
performance | Ruff | Rule has been stable since v0.0.285Automatic fix availableEnabled by default |
RUF018 |
assignment-in-assertAvoid assignment expressions in assert statements |
suspicious | Ruff | Rule has been stable since v0.2.0Enabled by default |
RUF019 |
unnecessary-key-checkUnnecessary key check before dictionary access |
complexity | Ruff | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
RUF020 |
never-union{never_like} | T is equivalent to T |
correctness | Ruff | Rule has been stable since v0.2.0Automatic fix availableEnabled by default |
RUF021 |
parenthesize-chained-operatorsParenthesize a and b expressions when chaining and and or together, to make the precedence clear |
pedantic | Ruff | Rule has been stable since 0.8.0Automatic fix available |
RUF022 |
unsorted-dunder-all__all__ is not sorted |
style | Ruff | Rule has been stable since 0.8.0Automatic fix availableEnabled by default |
RUF023 |
unsorted-dunder-slots{}.__slots__ is not sorted |
style | Ruff | Rule has been stable since 0.8.0Automatic fix availableEnabled by default |
RUF024 |
mutable-fromkeys-valueDo not pass mutable objects as values to dict.fromkeys |
suspicious | Ruff | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
RUF026 |
default-factory-kwargdefault_factory is a positional-only argument to defaultdict |
correctness | Ruff | Rule has been stable since 0.5.0Automatic fix availableEnabled by default |
RUF027 |
missing-f-string-syntaxPossible f-string without an f prefix |
suspicious | Ruff | Rule has been in preview since v0.2.1Automatic fix available |
RUF028 |
invalid-formatter-suppression-commentThis suppression comment is invalid because {} |
suspicious | Ruff | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
RUF029 |
unused-asyncFunction {name} is declared async, but doesn't await or use async features. |
pedantic | Ruff | Rule has been in preview since v0.4.0 |
RUF030 |
assert-with-print-messageprint() call in assert statement is likely unintentional |
correctness | Ruff | Rule has been stable since 0.8.0Automatic fix availableEnabled by default |
RUF031 |
incorrectly-parenthesized-tuple-in-subscriptUse parentheses for tuples in subscripts |
pedantic | Ruff | Rule has been in preview since 0.5.7Automatic fix available |
RUF032 |
decimal-from-float-literalDecimal() called with float literal argument |
suspicious | Ruff | Rule has been stable since 0.9.0Automatic fix availableEnabled by default |
RUF033 |
post-init-default__post_init__ method with argument defaults |
suspicious | Ruff | Rule has been stable since 0.9.0Automatic fix availableEnabled by default |
RUF034 |
useless-if-elseUseless if-else condition |
correctness | Ruff | Rule has been stable since 0.9.0Enabled by default |
RUF035 |
ruff-unsafe-markup-useUnsafe use of {name} detected |
security | Ruff | Rule was removed in 0.10.0 |
RUF036 |
none-not-at-end-of-unionNone not at the end of the type union. |
style | Ruff | Rule has been stable since 0.16.0Automatic fix available |
RUF037 |
unnecessary-empty-iterable-within-deque-callUnnecessary empty iterable within a deque call |
complexity | Ruff | Rule has been stable since 0.15.0Automatic fix available |
RUF038 |
redundant-bool-literalLiteral[True, False, ...] can be replaced with Literal[...] | bool |
complexity | Ruff | Rule has been in preview since 0.8.0Automatic fix available |
RUF039 |
unraw-re-patternFirst argument to {call} is not raw string |
pedantic | Ruff | Rule has been in preview since 0.8.0Automatic fix available |
RUF040 |
invalid-assert-message-literal-argumentNon-string literal used as assert message |
suspicious | Ruff | Rule has been stable since 0.10.0Enabled by default |
RUF041 |
unnecessary-nested-literalUnnecessary nested Literal |
style | Ruff | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
RUF043 |
pytest-raises-ambiguous-patternPattern passed to match= contains metacharacters but is neither escaped nor raw |
style | Ruff | Rule has been stable since 0.13.0 |
RUF045 |
implicit-class-var-in-dataclassAssignment without annotation found in dataclass body |
suspicious | Ruff | Rule has been in preview since 0.9.7 |
RUF046 |
unnecessary-cast-to-intValue being cast to int is already an integer |
complexity | Ruff | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
RUF047 |
needless-elseEmpty else clause |
style | Ruff | Rule has been in preview since 0.9.3Automatic fix available |
RUF048 |
map-int-version-parsing__version__ may contain non-integral-like elements |
suspicious | Ruff | Rule has been stable since 0.10.0Enabled by default |
RUF049 |
dataclass-enumAn enum class should not be decorated with @dataclass |
correctness | Ruff | Rule has been stable since 0.12.0Enabled by default |
RUF050 |
unnecessary-ifEmpty if statement |
complexity | Ruff | Rule has been in preview since 0.15.8Automatic fix available |
RUF051 |
if-key-in-dict-delUse pop instead of key in dict followed by del dict[key] |
complexity | Ruff | Rule has been stable since 0.10.0Automatic fix availableEnabled by default |
RUF052 |
used-dummy-variableLocal dummy variable {} is accessed |
pedantic | Ruff | Rule has been in preview since 0.8.2Automatic fix available |
RUF053 |
class-with-mixed-type-varsClass with type parameter list inherits from Generic |
correctness | Ruff | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
RUF054 |
indented-form-feedIndented form feed |
correctness | Ruff | Rule has been in preview since 0.9.6 |
RUF055 |
unnecessary-regular-expressionPlain string pattern passed to re function |
complexity | Ruff | Rule has been in preview since 0.8.1Automatic fix available |
RUF056 |
falsy-dict-get-fallbackAvoid providing a falsy fallback to dict.get() in boolean test positions. The default fallback None is already falsy. |
complexity | Ruff | Rule has been in preview since 0.8.5Automatic fix available |
RUF057 |
unnecessary-roundValue being rounded is already an integer |
complexity | Ruff | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
RUF058 |
starmap-zipitertools.starmap called on zip iterable |
complexity | Ruff | Rule has been stable since 0.12.0Automatic fix availableEnabled by default |
RUF059 |
unused-unpacked-variableUnpacked variable {name} is never used |
suspicious | Ruff | Rule has been stable since 0.13.0Automatic fix availableEnabled by default |
RUF060 |
in-empty-collectionUnnecessary membership test on empty collection |
correctness | Ruff | Rule has been stable since 0.15.0 |
RUF061 |
legacy-form-pytest-raisesUse context-manager form of pytest.{}() |
style | Ruff | Rule has been stable since 0.15.0Automatic fix available |
RUF063 |
access-annotations-from-class-dictUse {suggestion} instead of __dict__ access |
suspicious | Ruff | Rule has been stable since 0.16.0Enabled by default |
RUF064 |
non-octal-permissionsNon-octal mode |
suspicious | Ruff | Rule has been stable since 0.15.0Automatic fix available |
RUF065 |
logging-eager-conversionUnnecessary oct() conversion when formatting with %s. Use %#o instead of %s |
performance | Ruff | Rule has been in preview since 0.13.2 |
RUF066 |
property-without-return{name} is a property without a return statement |
correctness | Ruff | Rule has been in preview since 0.14.7 |
RUF067 |
non-empty-init-module__init__ module should not contain any code |
pedantic | Ruff | Rule has been in preview since 0.14.11 |
RUF068 |
duplicate-entry-in-dunder-all__all__ contains duplicate entries |
correctness | Ruff | Rule has been stable since 0.16.0Automatic fix availableEnabled by default |
RUF069 |
float-equality-comparisonUnreliable floating point equality comparison {left} {operator} {right} |
suspicious | Ruff | Rule has been in preview since 0.15.1 |
RUF070 |
unnecessary-assign-before-yieldUnnecessary assignment to {name} before yield from statement |
pedantic | Ruff | Rule has been in preview since 0.15.3Automatic fix available |
RUF071 |
os-path-commonprefixos.path.commonprefix() compares strings character-by-character |
suspicious | Ruff | Rule has been in preview since 0.15.6Automatic fix available |
RUF072 |
useless-finallyEmpty finally clause |
complexity | Ruff | Rule has been in preview since 0.15.8Automatic fix available |
RUF073 |
f-string-percent-format% operator used on an f-string |
suspicious | Ruff | Rule has been in preview since 0.15.8 |
RUF074 |
incorrect-decorator-order@{outer_decorator} should be placed after @{inner_decorator} |
correctness | Ruff | Rule has been in preview since 0.15.14 |
RUF075 |
fallible-context-managerContext manager does not catch exceptions |
suspicious | Ruff | Rule has been in preview since 0.15.14 |
RUF077 |
method-receiver-defaultReceiver parameter should not have a default value |
suspicious | Ruff | Rule has been in preview since 0.16.7Automatic fix available |
RUF100 |
unused-noqaUnused {} |
suspicious | Ruff | Rule has been stable since v0.0.155Automatic fix availableEnabled by default |
RUF101 |
redirected-noqa{original} is a redirect to {target} |
suspicious | Ruff | Rule has been stable since 0.6.0Automatic fix availableEnabled by default |
RUF102 |
invalid-rule-codeInvalid rule code in {}: {} |
suspicious | Ruff | Rule has been stable since 0.15.0Automatic fix available |
RUF103 |
invalid-suppression-commentInvalid suppression comment: {msg} |
suspicious | Ruff | Rule has been stable since 0.15.0Automatic fix available |
RUF104 |
unmatched-suppression-commentSuppression comment without matching #ruff:enable comment |
suspicious | Ruff | Rule has been stable since 0.15.0 |
RUF105 |
noqa-commentsnoqa comment used instead of ruff: ignore |
pedantic | Ruff | Rule has been in preview since 0.15.22Automatic fix available |
RUF106 |
rule-codes-in-suppression-commentsRule code used instead of name in suppression comment |
style | Ruff | Rule has been in preview since 0.15.22Automatic fix available |
RUF200 |
invalid-pyproject-tomlFailed to parse pyproject.toml: {message} |
correctness | Ruff | Rule has been stable since v0.0.271Enabled by default |
RUF201 |
rule-codes-in-selectorsRule code used instead of name in lint.{selector} |
pedantic | Ruff | Rule has been in preview since 0.15.22Automatic fix available |
TRY002 |
raise-vanilla-classCreate your own exception |
style | tryceratops | Rule has been stable since v0.0.236Enabled by default |
TRY003 |
raise-vanilla-argsAvoid specifying long messages outside the exception class |
pedantic | tryceratops | Rule has been stable since v0.0.236 |
TRY004 |
type-check-without-type-errorPrefer TypeError exception for invalid type |
style | tryceratops | Rule has been stable since v0.0.230Enabled by default |
TRY200 |
reraise-no-causeUse raise from to specify exception cause |
pedantic | tryceratops | Rule was removed in v0.2.0 |
TRY201 |
verbose-raiseUse raise without specifying exception name |
complexity | tryceratops | Rule has been stable since v0.0.231Automatic fix availableEnabled by default |
TRY203 |
useless-try-exceptRemove exception handler; error is immediately re-raised |
complexity | tryceratops | Rule has been stable since 0.7.0Enabled by default |
TRY300 |
try-consider-elseConsider moving this statement to an else block |
pedantic | tryceratops | Rule has been stable since v0.0.229 |
TRY301 |
raise-within-tryAbstract raise to an inner function |
pedantic | tryceratops | Rule has been stable since v0.0.233 |
TRY400 |
error-instead-of-exceptionUse logging.exception instead of logging.error |
pedantic | tryceratops | Rule has been stable since v0.0.236Automatic fix available |
TRY401 |
verbose-log-messageRedundant exception object included in logging.exception call |
complexity | tryceratops | Rule has been stable since v0.0.250Enabled by default |
| โ | pytest-fixture-autouseAvoid using autouse=True in pytest.fixture decorators |
restriction | โ | Rule has been in preview since 0.16.5 |