Flakes: list of flake8 plugins and their codes


A utility for ensuring Google-style docstrings stay up to date with the source code.

DAR000 Failed to parse file due to syntax error.
DAR001 The docstring was not parsed correctly due to a syntax error.
DAR002 An argument/exception lacks a description
DAR003 A line is under-indented or over-indented.
DAR004 The docstring contains an extra newline where it shouldn't.
DAR005 The item contains a type section (parentheses), but no type.
DAR101 The docstring is missing a parameter in the definition.
DAR102 The docstring contains a parameter not in function.
DAR103 The docstring parameter type doesn't match function.
DAR104 The docstring parameter type is not given.
DAR105 The docstring parameter type is malformed. Expected parameter type to match syntax from PEP484. If your parameter contains parentheses, you may want to switch them to brackets. E.g. `Union[str, int]`.
DAR201 The docstring is missing a return from definition.
DAR202 The docstring has a return not in definition.
DAR203 The docstring parameter type doesn't match function.
DAR301 The docstring is missing a yield present in definition.
DAR302 The docstring has a yield not in definition.
DAR401 The docstring is missing an exception raised.
DAR402 The docstring describes an exception not explicitly raised.
DAR501 The docstring describes a variable which is not defined.


Dlint is a tool for encouraging best coding practices and helping ensure Python code is secure.

DUO101 "inlineCallbacks" function cannot have non-empty "return" statement
DUO102 insecure use of "random" module, prefer "random.SystemRandom"
DUO103 insecure use of "pickle" or "cPickle"
DUO104 use of "eval" is insecure
DUO105 use of "exec" is insecure
DUO106 insecure use of "os" module
DUO107 insecure use of XML modules, prefer "defusedxml"
DUO108 use of "input" is insecure
DUO109 insecure use of "yaml" parsing function, prefer "safe_*" equivalent
DUO110 use of "compile" is insecure
DUO111 insecure use of "sys" module
DUO112 use of "extract|extractall" is insecure
DUO113 "inlineCallbacks" function missing "yield" statement
DUO114 "returnValue" in function missing "inlineCallbacks" decorator
DUO115 use of "extract|extractall" is insecure
DUO116 use of "shell=True" is insecure in "subprocess" module
DUO117 avoid "dl" module use
DUO118 avoid "gl" module use
DUO119 avoid "shelve" module use
DUO120 avoid "marshal" module use
DUO121 use of "tempfile.mktemp" allows for race conditions
DUO122 insecure "ssl" module attribute use
DUO123 use of "verify=False" is insecure in "requests" module
DUO124 instance with "allow_dotted_names" enabled is insecure
DUO125 avoid "commands" module use
DUO126 avoid "popen2" module use
DUO127 use of "ca_certs=HTTP|DISABLE" is insecure in "duo_client" module
DUO128 insecure "OneLogin" SAML function call
DUO129 insecure "OneLogin" SAML attribute use
DUO130 insecure use of "hashlib" module
DUO131 "urllib3" warnings disabled, insecure connections possible
DUO132 "urllib3" certificate verification disabled, insecure connections possible
DUO133 use of "Crypto" module is insecure
DUO134 insecure "cryptography" attribute use
DUO135 enable all "forbid_*" defenses when using "defusedxml" parsing
DUO136 insecure "xmlsec" attribute use
DUO137 insecure "itsdangerous" use allowing empty signing
DUO138 catastrophic "re" usage - denial-of-service possible


flake8 plugin which checks for misuse of `sys.version` or `sys.version_info`

YTT101 `sys.version[:3]` referenced (python3.10), use `sys.version_info`
YTT102 `sys.version[2]` referenced (python3.10), use `sys.version_info`
YTT103 `sys.version` compared to string (python3.10), use `sys.version_info`
YTT201 `sys.version_info[0] == 3` referenced (python4), use `>=`
YTT202 `six.PY3` referenced (python4), use `not six.PY2`
YTT203 `sys.version_info[1]` compared to integer (python4), compare `sys.version_info` to tuple
YTT204 `sys.version_info.minor` compared to integer (python4), compare `sys.version_info` to tuple
YTT301 `sys.version[0]` referenced (python10), use `sys.version_info`
YTT302 `sys.version` compared to string (python10), use `sys.version_info`
YTT303 `sys.version[:1]` referenced (python10), use `sys.version_info`


A Flake8 plugin that checks Python tests follow the Arrange-Act-Assert pattern

AAA03 expected 1 blank line before Act block, found {}
AAA04 expected 1 blank line before Assert block, found {}
AAA05 blank line in block
AAA06 comment in Act block
AAA99 collision when marking line


flake8 plugin to require absolute imports

ABS101 Relative import found


Flake8 plugin warning for unsafe functions

B1 banned symbol


A flake8 extension that checks for type annotations complexity

TAE002 too complex annotation ({0} > {1})
TAE003 too long annotation ({0} > {1})


Automated security testing with bandit and flake8.

S101 assert used
S102 exec used
S103 set bad file permissions
S104 hardcoded bind all interfaces
S105 hardcoded password string
S106 hardcoded password funcarg
S107 hardcoded password default
S108 hardcoded tmp directory
S110 try except pass
S112 try except continue
S201 flask debug true
S301 Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
S302 Deserialization with the marshal module is possibly dangerous.
S303 Use of insecure MD2, MD4, MD5, or SHA1 hash function.
S304 Use of insecure cipher {name}. Replace with a known secure cipher such as AES.
S305 Use of insecure cipher mode {name}.
S306 Use of insecure and deprecated function (mktemp).
S307 Use of possibly insecure function - consider using safer ast.literal_eval.
S308 Use of mark_safe() may expose cross-site scripting vulnerabilities and should be reviewed.
S309 Use of HTTPSConnection on older versions of Python prior to 2.7.9 and 3.4.3 do not provide security, see https://wiki.openstack.org/wiki/OSSN/OSSN-0033
S310 Audit url open for permitted schemes. Allowing use of file:/ or custom schemes is often unexpected.
S311 Standard pseudo-random generators are not suitable for security/cryptographic purposes.
S312 Telnet-related functions are being called. Telnet is considered insecure. Use SSH or some other encrypted protocol.
S313 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
S314 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
S315 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
S316 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
S317 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
S318 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
S319 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function or make sure defusedxml.defuse_stdlib() is called
S320 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with its defusedxml equivalent function.
S321 FTP-related functions are being called. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol.
S323 By default, Python will create a secure, verified ssl context for use in such classes as HTTPSConnection. However, it still 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.
S324 hashlib insecure functions
S325 Use of os.tempnam() and os.tmpnam() is vulnerable to symlink attacks. Consider using tmpfile() instead.
S401 A telnet-related module is being imported. Telnet is considered insecure. Use SSH or some other encrypted protocol.
S402 A FTP-related module is being imported. FTP is considered insecure. Use SSH/SFTP/SCP or some other encrypted protocol.
S403 Consider possible security implications associated with {name} module.
S404 Consider possible security implications associated with the subprocess module.
S405 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
S406 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
S407 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
S408 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
S409 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with the equivalent defusedxml package, or make sure defusedxml.defuse_stdlib() is called.
S410 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Replace {name} with the equivalent defusedxml package.
S411 Using {name} to parse untrusted XML data is known to be vulnerable to XML attacks. Use defused.xmlrpc.monkey_patch() function to monkey-patch xmlrpclib and mitigate XML vulnerabilities.
S412 Consider possible security implications associated with {name} module.
S413 The pyCrypto library and its module {name} are no longer actively maintained and have been deprecated. Consider using pyca/cryptography library.
S415 An IPMI-related module is being imported. IPMI is considered insecure. Use an encrypted protocol.
S501 request with no cert validation
S502 ssl with bad version
S503 ssl with bad defaults
S504 ssl with no version
S505 weak cryptographic key
S506 yaml load
S507 ssh no host key verification
S508 snmp insecure version
S509 snmp weak cryptography
S601 paramiko calls
S602 subprocess popen with shell equals true
S603 subprocess without shell equals true
S604 any other function with shell equals true
S605 start process with a shell
S606 start process with no shell
S607 start process with partial path
S608 hardcoded sql expressions
S609 linux commands wildcard injection
S610 django extra used
S611 django rawsql used
S701 jinja2 autoescape false
S702 use of mako templates
S703 django mark safe


flake8 plugin to call black as a code style validator

BLK901 Invalid input
BLK997 Invalid TOML file
BLK999 Unexpected exception


Flake8 plugin to forbid backslashes for line breaks

N400 Found backslash that is used for line breaking


A plugin for flake8 finding likely bugs and design problems in your program. Contains warnings that don't belong in pyflakes and pycodestyle.

B001 Do not use {}, it also catches unexpected events like memory errors, interrupts, system exit, and so on. Prefer `except Exception:`. If you're sure what you're doing, be explicit and write `except BaseException:`.
B002 Python does not support the unary prefix increment. Writing ++n is equivalent to +(+(n)), which equals n. You meant n += 1.
B003 Assigning to `os.environ` doesn't clear the environment. Subprocesses are going to see outdated variables, in disagreement with the current process. Use `os.environ.clear()` or the `env=` argument to Popen.
B004 Using `hasattr(x, '__call__')` to test if `x` is callable is unreliable. If `x` implements custom `__getattr__` or its `__call__` is itself not callable, you might get misleading results. Use `callable(x)` for consistent results.
B005 Using .strip() with multi-character strings is misleading the reader. It looks like stripping a substring. Move your character set to a constant if this is deliberate. Use .replace() or regular expressions to remove string fragments.
B006 Do not use mutable data structures for argument defaults. They are created during function definition time. All calls to the function reuse this one instance of that data structure, persisting changes between them.
B007 Loop control variable {!r} not used within the loop body. If this is intended, start the name with an underscore.
B008 Do not perform function calls in argument defaults. The call is performed only once at function definition time. All calls to your function will reuse the result of that definition-time function call. If this is intended, assign the function call to a module-level variable and use that variable as a default value.
B009 Do not call getattr with a constant attribute value, it is not any safer than normal property access.
B010 Do not call setattr with a constant attribute value, it is not any safer than normal property access.
B011 Do not call assert False since python -O removes these calls. Instead callers should raise AssertionError().
B012 return/continue/break inside finally blocks cause exceptions to be silenced. Exceptions should be silenced in except blocks. Control statements can be moved outside the finally block.
B013 A length-one tuple literal is redundant. Write `except {0}:` instead of `except ({0},):`.
B014 Redundant exception types in `except ({0}){1}:`. Write `except {2}{1}:`, which catches exactly the same exceptions.
B015 Pointless comparison. This comparison does nothing but waste CPU instructions. Either prepend `assert` or remove it.
B016 Cannot raise a literal. Did you intend to return it or raise an Exception?
B017 assertRaises(Exception): should be considered evil. It can lead to your test passing even if the code being tested is never executed due to a typo. Either assert for a more specific exception (builtin or custom), use assertRaisesRegex, or use the context manager form of assertRaises.
B018 Found useless expression. Either assign it to a variable or remove it.
B019 Use of `functools.lru_cache` or `functools.cache` on methods can lead to memory leaks. The cache may retain instance references, preventing garbage collection.
B020 Found for loop that reassigns the iterable it is iterating
B021 f-string used as docstring.This will be interpreted by python as a joined string rather than a docstring.
B022 No arguments passed to `contextlib.suppress`.No exceptions will be suppressed and therefore thiscontext manager is redundant.
B901 Using `yield` together with `return x`. Use native `async def` coroutines or put a `# noqa` comment on this line if this was intentional.
B902 Invalid first argument {} used for {} method. Use the canonical first argument name in methods, i.e. {}.
B903 Data class should either be immutable or use __slots__ to save memory. Use collections.namedtuple to generate an immutable class, or enumerate the attributes in a __slot__ declaration in the class to leave attributes mutable.
B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling. See https://docs.python.org/3/tutorial/errors.html#exception-chaining for details.
B950 line too long ({} > {} characters)


Check for python builtins being used as variables or parameters.

A001 variable "{0}" is shadowing a python builtin
A002 argument "{0}" is shadowing a python builtin
A003 class attribute "{0}" is shadowing a python builtin


Adds coding magic comment checks to flake8

C101 Coding magic comment not found
C102 Unknown encoding found in coding magic comment
C103 Coding magic comment present


An extension for flake8 that validates cognitive functions complexity

CCR001 Cognitive complexity is too high (


Flake8 lint for trailing commas.

C812 missing trailing comma
C813 missing trailing comma in Python 3
C814 missing trailing comma in Python 2
C815 missing trailing comma in Python 3.5+
C816 missing trailing comma in Python 3.6+


A flake8 plugin to help you write better list/set/dict comprehensions.

C400 Unnecessary generator - rewrite as a list comprehension.
C401 Unnecessary generator - rewrite as a set comprehension.
C402 Unnecessary generator - rewrite as a dict comprehension.
C403 Unnecessary list comprehension - rewrite as a set comprehension.
C404 Unnecessary list comprehension - rewrite as a dict comprehension.
C405 Unnecessary {type} literal -
C406 Unnecessary {type} literal -
C408 Unnecessary {type} call - rewrite as a literal.
C409 Unnecessary {type} passed to tuple() -
C410 Unnecessary {type} passed to list() -
C411 Unnecessary list call - remove the outer call to list().
C413 Unnecessary {outer} call around {inner}(){remediation}.
C414 Unnecessary {inner} call within {outer}().
C415 Unnecessary subscript reversal of iterable within {func}().
C416 Unnecessary {type} comprehension - rewrite using {type}().
C417 Unnecessary use of map - use a {comp} instead.


ipdb/pdb statement checker plugin for flake8

T100 trace found


Plugin to catch bad style specific to Django Projects.

DJ01 Avoid using null=True on string-based fields such {field}.
DJ03 Avoid passing locals() as context to a render function
DJ06 Do not use exclude with ModelForm, use fields instead
DJ07 Do not use __all__ with ModelForm, use fields instead
DJ08 Model does not define __str__ method
DJ10 Model should define verbose_name in its Meta inner class


Extension for flake8 which uses pydocstyle to check docstrings

D100 Missing docstring in public module
D101 Missing docstring in public class
D102 Missing docstring in public method
D103 Missing docstring in public function
D104 Missing docstring in public package
D105 Missing docstring in magic method
D106 Missing docstring in public nested class
D107 Missing docstring in __init__
D200 One-line docstring should fit on one line with quotes
D201 No blank lines allowed before function docstring
D202 No blank lines allowed after function docstring
D203 1 blank line required before class docstring
D204 1 blank line required after class docstring
D205 1 blank line required between summary line and description
D206 Docstring should be indented with spaces, not tabs
D207 Docstring is under-indented
D208 Docstring is over-indented
D209 Multi-line docstring closing quotes should be on a separate line
D210 No whitespaces allowed surrounding docstring text
D211 No blank lines allowed before class docstring
D212 Multi-line docstring summary should start at the first line
D213 Multi-line docstring summary should start at the second line
D214 Section is over-indented
D215 Section underline is over-indented
D300 Use """triple double quotes"""
D301 Use r""" if any backslashes in a docstring
D302 Deprecated: Use u""" for Unicode docstrings
D400 First line should end with a period
D401 First line should be in imperative mood; try rephrasing
D402 First line should not be the function's "signature"
D403 First word of the first line should be properly capitalized
D404 First word of the docstring should not be `This`
D405 Section name should be properly capitalized
D406 Section name should end with a newline
D407 Missing dashed underline after section
D408 Section underline should be in the line following the section's name
D409 Section underline should match the length of its name
D410 Missing blank line after section
D411 Missing blank line before section
D412 No blank lines allowed between a section header and its content
D413 Missing blank line after last section
D414 Section has no content
D415 First line should end with a period, question mark, or exclamation point
D416 Section name should end with a colon
D417 Missing argument descriptions in the docstring
D418 Function/ Method decorated with @overload shouldn't contain a docstring


Flake8 plugin to find commented out code

E800 Found commented out code: {0}


A Flake8 plugin for checking executable permissions and shebangs.

EXE001 Shebang is present but the file is not executable.
EXE002 The file is executable but no shebang is present.
EXE003 Shebang is present but does not contain "python":
EXE004 There is whitespace before shebang.
EXE005 There are blank or comment lines before shebang.


A flake8 extension that checks expressions complexity

ECE001 Expression is too complex (


Check for FIXME, TODO and other temporary developer notes. Plugin for flake8.

T100 fixme found (FIXME)
T101 fixme found (TODO)
T102 fixme found (XXX)
T103 fixme found (HACK)


A flake8 extension that checks functions

CFQ001 Function
CFQ002 Function "
CFQ003 Function "


__future__ import checker, plugin for flake8

FI10 __future__ import "division" missing
FI11 __future__ import "absolute_import" missing
FI12 __future__ import "with_statement" missing
FI13 __future__ import "print_function" missing
FI14 __future__ import "unicode_literals" missing
FI15 __future__ import "generator_stop" missing
FI16 __future__ import "nested_scopes" missing
FI17 __future__ import "generators" missing
FI18 __future__ import "annotations" missing
FI50 __future__ import "division" present
FI51 __future__ import "absolute_import" present
FI52 __future__ import "with_statement" present
FI53 __future__ import "print_function" present
FI54 __future__ import "unicode_literals" present
FI55 __future__ import "generator_stop" present
FI56 __future__ import "nested_scopes" present
FI57 __future__ import "generators" present
FI58 __future__ import "annotations" present
FI90 __future__ import does not exist


Flake8 and pylama plugin that checks the ordering of import statements.

I100 Import statements are in the wrong order.
I101 Imported names are in the wrong order.
I201 Missing newline between import groups.
I202 Additional newline in a group of imports.
I666 Import statement mixes groups.


flake8 plugin that integrates isort .

I001 isort found an import in the wrong position
I002 no configuration found (.isort.cfg or [isort] in configs)
I003 isort expected 1 blank line in imports, found 0
I004 isort found an unexpected blank line in imports
I005 isort found an unexpected missing import


Flake8 plugin for a smart line length validation.

LN001 code line is too long
LN002 doc/comment line is too long


Flake8 extension to validate (lack of) logging format strings

G001 Logging statement uses string.format()
G002 Logging statement uses '%'
G003 Logging statement uses '+'
G004 Logging statement uses f-string
G010 Logging statement uses 'warn' instead of 'warning'
G100 Logging statement uses non-whitelisted extra keyword argument: {}
G200 Logging statement uses exception in arguments
G201 Logging: .exception(...) should be used instead of .error(..., exc_info=True)
G202 Logging statement has redundant exc_info


Provides checking for non-existent mock methods

M001 %s is a non-existent mock method.


mutable defaults flake8 extension

M511 {} - mutable default arg of type {}


A plugin for flake8 integrating mypy.

T400 note: {}
T484 {}
T498 Internal mypy error '{}': {}
T499 {}


Checks for old string formatting.

S001 found modulo formatter


A flake8 extension that implements misc. lints

PIE781 You are assigning to a variable and then returning. Instead remove the assignment and return.
PIE783 Celery tasks should have explicit names.
PIE784 Celery crontab is missing explicit arguments.
PIE785 Celery tasks should have expirations.
PIE786 Use precise exception handlers.
PIE787 no-len-condition: Remove len() call or compare against a scalar.
PIE788 no-bool-condition: Remove unnecessary bool() call.
PIE789 prefer-isinstance-type-compare: Use isinstance for comparing types.
PIE790 no-unnecessary-pass: `pass` can be removed.
PIE791 no-pointless-statements: Statement looks unnecessary.
PIE792 no-inherit-object: Inheriting from object is unnecssary in python3.
PIE793 prefer-dataclass: Consider using a @dataclass.
PIE794 no-dupe-class-field-defs: This field is duplicated.
PIE795 prefer-stdlib-enum: Considering using the builtin enum type.
PIE796 prefer-unique-enums: Consider using removing dupe values.
PIE797 no-unnecessary-if-expr: Consider using bool() instead of an if expression.
PIE798 no-unnecessary-class: Consider using a module for namespacing instead.
PIE799 prefer-col-init: Consider passing values in when creating the collection.
PIE800 no-unnecessary-spread: Consider inlining the dict values.
PIE801 prefer-simple-return: Return boolean expressions directly instead of returning `True` and `False`.
PIE802 prefer-simple-any-all: remove unnecessary comprehension.
PIE803 prefer-logging-interpolation: Use lazy % formatting in logging functions.
PIE804 no-unnecessary-dict-kwargs: Remove the dict and pass the kwargs directly.
PIE805 prefer-literal: Prefer the byte string literal rather than calling encode.
PIE806 no-assert-except: Instead of asserting and catching, use an if statment.
PIE807 prefer-list-builtin: use the builtin list type instead of a lambda.
PIE808 prefer-simple-range: range starts at 0 by default.
PIE809 django-prefer-bulk: bulk create multiple objects.


print statement checker plugin for flake8

T201 print found.
T202 Python 2.x reserved word print used.
T203 pprint found.
T204 pprint declared


flake8 plugin which forbids printf-style string formatting

MOD001 do not use printf-style string formatting


A plugin for flake8 to enable linting .pyi files.

Y001 Y001 Name of private {} must start with _
Y002 Y002 If test must be a simple comparison against sys.platform or sys.version_info
Y003 Y003 Unrecognized sys.version_info check
Y004 Y004 Version comparison must use only major and minor version
Y005 Y005 Version comparison must be against a length-{n} tuple
Y006 Y006 Use only < and >= for version comparisons
Y007 Y007 Unrecognized sys.platform check
Y008 Y008 Unrecognized platform "{platform}"
Y009 Y009 Empty body should contain "...", not "pass"
Y010 Y010 Function body must contain only "..."
Y011 Y011 Default values for typed arguments must be "..."
Y012 Y012 Class body must not contain "pass"
Y013 Y013 Non-empty class body must not contain "..."
Y014 Y014 Default values for arguments must be "..."
Y015 Y015 Bad default value. Use "{new_syntax}" instead of "{old_syntax}"
Y016 Y016 Duplicate union member "{}"
Y017 Y017 Only simple assignments allowed
Y018 Y018 {typevarlike_cls} "{typevar_name}" is not used
Y019 Y019 Use "_typeshed.Self" instead of "{typevar_name}", e.g. "{new_syntax}"
Y020 Y020 Quoted annotations should never be used in stubs
Y021 Y021 Docstrings should not be included in stubs
Y022 Y022 Use {good_syntax} instead of {bad_syntax} (PEP 585 syntax)
Y023 Y023 Use {good_syntax} instead of {bad_syntax}
Y024 Y024 Use "typing.NamedTuple" instead of "collections.namedtuple"
Y025 Y025 Use "from collections.abc import Set as AbstractSet" to avoid confusion with "builtins.set"
Y026 Y026 Use typing_extensions.TypeAlias for type aliases
Y027 Y027 Use {good_syntax} instead of {bad_syntax} (PEP 585 syntax)
Y028 Y028 Use class-based syntax for NamedTuples
Y029 Y029 Defining __repr__ or __str__ in a stub is almost always redundant
Y030 Y030 Multiple Literal members in a union. {suggestion}
Y031 Y031 Use class-based syntax for TypedDicts where possible
Y032 Y032 Prefer "object" to "Any" for the second parameter in "{method_name}" methods
Y033 Y033 Do not use type comments in stubs (e.g. use "x: int" instead of "x = ... # type: int")
Y034 Y034 {methods} usually return "self" at runtime. Consider using "_typeshed.Self" in "{method_name}", e.g. "{suggested_syntax}"
Y035 Y035 "{var}" in a stub file must have a value, as it has the same semantics as "{var}" at runtime.
Y036 Y036 Badly defined {method_name} method: {details}
Y037 Y037 Use PEP 604 union types instead of {old_syntax} (e.g. {example}).
Y038 Y038 Use "from collections.abc import Set as AbstractSet" instead of "from typing import AbstractSet" (PEP 585 syntax)
Y039 Y039 Use "str" instead of "typing.Text"
Y040 Y040 Do not inherit from "object" explicitly, as it is redundant in Python 3


pytest assert checker plugin for flake8

T003 use of Django-style assert statement found (instead of regular assert)


A flake8 plugin checking common style issues or inconsistencies with pytest-based tests.

PT001 use @pytest.fixture{expected_parens} over @pytest.fixture{actual_parens}
PT002 configuration for fixture '{name}' specified via positional args, use kwargs
PT003 scope='function' is implied in @pytest.fixture()
PT004 fixture '{name}' does not return anything, add leading underscore
PT005 fixture '{name}' returns a value, remove leading underscore
PT006 wrong name(s) type in @pytest.mark.parametrize, expected {expected_type}
PT007 wrong values type in @pytest.mark.parametrize, expected {expected_type}
PT008 use return_value= instead of patching with lambda
PT009 use a regular assert instead of unittest-style '{assertion}'
PT010 set the expected exception in pytest.raises()
PT011 pytest.raises({exception}) is too broad, set the match parameter or use a more specific exception
PT012 pytest.raises() block should contain a single simple statement
PT013 found incorrect import of pytest, use simple 'import pytest' instead
PT014 found duplicate test cases {indexes} in @pytest.mark.parametrize
PT015 assertion always fails, replace with pytest.fail()
PT016 no message passed to pytest.fail()
PT017 found assertion on exception {name} in except block, use pytest.raises() instead
PT018 assertion should be broken down into multiple parts
PT019 fixture {name} without value is injected as parameter, use @pytest.mark.usefixtures instead
PT020 @pytest.yield_fixture is deprecated, use @pytest.fixture
PT021 use yield instead of request.addfinalizer
PT022 no teardown in fixture {name}, use return instead of yield
PT023 use @pytest.mark.{mark_name}{expected_parens} over @pytest.mark.{mark_name}{actual_parens}
PT024 pytest.mark.asyncio is unnecessary for fixtures
PT025 pytest.mark.usefixtures has no effect on fixtures
PT026 useless pytest.mark.usefixtures without parameters


Flake8 lint for quotes.

Q003 Change outer quotes to avoid escaping inner quotes


Package requirements checker, plugin for flake8

I900 '{pkg}' not listed as a requirement
I901 '{pkg}' required but not used


Python docstring reStructuredText (RST) validator

RST101 Possible title underline, too short for the title.
RST102 Unexpected possible title overline or transition.
RST201 Block quote ends without a blank line; unexpected unindent.
RST202 Bullet list ends without a blank line; unexpected unindent.
RST203 Definition list ends without a blank line; unexpected unindent.
RST204 Enumerated list ends without a blank line; unexpected unindent.
RST205 Explicit markup ends without a blank line; unexpected unindent.
RST206 Field list ends without a blank line; unexpected unindent.
RST207 Literal block ends without a blank line; unexpected unindent.
RST208 Option list ends without a blank line; unexpected unindent.
RST210 Inline strong start-string without end-string.
RST211 Blank line required after table.
RST212 Title underline too short.
RST213 Inline emphasis start-string without end-string.
RST214 Inline literal start-string without end-string.
RST215 Inline interpreted text or phrase reference start-string without end-string.
RST216 Multiple roles in interpreted text (both prefix and suffix present; only one allowed).
RST217 Mismatch: both interpreted text role suffix and reference suffix.
RST218 Literal block expected; none found.
RST219 Inline substitution_reference start-string without end-string.
RST301 Unexpected indentation.
RST302 Malformed table.
RST303 Unknown directive type "*".
RST304 Unknown interpreted text role "*".
RST305 Undefined substitution referenced: "*".
RST306 Unknown target name: "*".
RST307 Error in "*" directive:
RST401 Unexpected section title.



SCP01 allowed_domains doesn't allow this URL from start_urls
SCP02 allowed_domains should not contain URLs
SCP03 urljoin(response.url, "/foo") can be replaced by response.urljoin("/foo")
SCP04 use response.selector or response.xpath or response.css instead


Spellcheck variables, comments and docstrings

SC100 Spelling error in comments
SC200 Spelling error in name


Flake8 plugin that checks SQL code against opinionated style rules

Q440 keyword {} is not uppercase
Q441 name {} is not valid, must be snake_case, and cannot end with `_`
Q442 avoid abbreviated keywords, {}
Q443 incorrect whitespace around comma
Q444 incorrect whitespace around equals
Q445 missing linespace between root_keywords {} and {}
Q446 missing newline after semicolon
Q447 root_keywords {} and {} are not right aligned
Q448 subquery should be aligned to the right of the river
Q449 token {} should be aligned to the right of the river


string format checker, plugin for flake8

P101 format string does contain unindexed parameters
P102 docstring does contain unindexed parameters
P103 other string does contain unindexed parameters
P201 format call uses too large index ({idx})
P202 format call uses missing keyword ({kw})
P203 format call uses keyword arguments but no named entries
P204 format call uses variable arguments but no numbered entries
P205 format call uses implicit and explicit indexes together
P301 format call provides unused index ({idx})
P302 format call provides unused keyword ({kw})


A flake8 plugin that helps you write tidier imports.

I250 Unnecessary import alias - rewrite as '{}'.
I251 Banned import '{name}' used - {msg}.
I252 Relative imports are banned.


TODO notes checker, plugin for flake8

T000 Todo note found.


Flake8 plugin for string formatting style.

FS001 '%' operator used
FS002 '.format' used
FS003 f-string missing prefix


A flake8 extension that helps to make more readable variables names

VNE001 single letter variable names like '{0}' are not allowed
VNE002 variable name '{0}' should be clarified
VNE003 variable names that shadow builtins are not allowed


McCabe checker, plugin for flake8

C901 %r is too complex (%d)


A flake8 plugin to lint pandas in an opinionated way

PD001 pandas should always be imported as 'import pandas as pd'
PD002 'inplace = True' should be avoided; it has inconsistent behavior
PD003 '.isna' is preferred to '.isnull'; functionality is equivalent
PD004 '.notna' is preferred to '.notnull'; functionality is equivalent
PD005 Use arithmetic operator instead of method
PD006 Use comparison operator instead of method
PD007 '.ix' is deprecated; use more explicit '.loc' or '.iloc'
PD008 Use '.loc' instead of '.at'. If speed is important, use numpy.
PD009 Use '.iloc' instead of '.iat'. If speed is important, use numpy.
PD010 '.pivot_table' is preferred to '.pivot' or '.unstack'; provides same functionality
PD011 Use '.array' or '.to_array()' instead of '.values'; 'values' is ambiguous
PD013 '.melt' is preferred to '.stack'; provides same functionality
PD015 Use '.merge' method instead of 'pd.merge' function. They have equivalent functionality.
PD901 'df' is a bad variable name. Be kinder to your future self.
PDO12 '.read_csv' is preferred to '.read_table'; provides same functionality


Check PEP-8 naming conventions, plugin for flake8

N801 class name '{name}' should use CapWords convention
N802 function name '{name}' should be lowercase
N803 argument name '{name}' should be lowercase
N804 first argument of a classmethod should be named 'cls'
N805 first argument of a method should be named 'self'
N806 variable '{name}' in function should be lowercase
N807 function name '{name}' should not start and end with '__'
N811 constant '{name}' imported as non constant '{asname}'
N812 lowercase '{name}' imported as non lowercase '{asname}'
N813 camelcase '{name}' imported as lowercase '{asname}'
N814 camelcase '{name}' imported as constant '{asname}'
N815 variable '{name}' in class scope should not be mixedCase
N816 variable '{name}' in global scope should not be mixedCase
N817 camelcase '{name}' imported as acronym '{asname}'
N818 exception name '{name}' should be named with an Error suffix


Python style guide checker

E101 indentation contains mixed spaces and tabs
E123 closing bracket does not match indentation of opening bracket's line
E124 closing bracket does not match visual indentation
E125 continuation line
E128 continuation line under-indented for visual indent
E129 visually indented line
E133 closing bracket is missing indentation
E201 whitespace after '%s'
E211 whitespace before '%s'
E221 multiple spaces before operator
E222 multiple spaces after operator
E223 tab before operator
E224 tab after operator
E225 missing whitespace around operator
E231 missing whitespace after '%s'
E241 multiple spaces after '%s'
E242 tab after '%s'
E251 unexpected spaces around keyword / parameter equals
E252 missing whitespace around parameter equals
E261 at least two spaces before inline comment
E262 inline comment should start with '# '
E265 block comment should start with '# '
E266 too many leading '#' for block comment
E271 multiple spaces after keyword
E272 multiple spaces before keyword
E273 tab after keyword
E274 tab before keyword
E275 missing whitespace after keyword
E301 expected %s blank line, found 0
E302 expected %s blank lines, found %d
E303 too many blank lines (%d)
E304 blank lines found after function decorator
E305 expected %s blank lines after class or function definition, found %d
E306 expected %s blank line before a nested definition, found 0
E401 multiple imports on one line
E402 module level import not at top of file
E501 line too long (%d > %d characters)
E502 the backslash is redundant between brackets
E701 multiple statements on one line (colon)
E702 multiple statements on one line (semicolon)
E703 statement ends with a semicolon
E704 multiple statements on one line (def)
E713 test for membership should be 'not in'
E714 test for object identity should be 'is not'
E721 do not compare types, use 'isinstance()'
E722 do not use bare 'except'
E731 do not assign a lambda expression, use a def
E741 ambiguous variable name '%s'
E742 ambiguous class definition '%s'
E743 ambiguous function definition '%s'
E901 %s: %s
E902 %s
W191 indentation contains tabs
W291 trailing whitespace
W292 no newline at end of file
W293 blank line contains whitespace
W391 blank line at end of file
W503 line break before binary operator
W504 line break after binary operator
W505 doc line too long (%d > %d characters)
W601 .has_key() is deprecated, use 'in'
W602 deprecated form of raising exception
W603 '<>' is deprecated, use '!='
W604 backticks are deprecated, use 'repr()'
W605 invalid escape sequence '\%s'
W606 'async' and 'await' are reserved keywords starting with Python 3.7


passive checker of Python programs

F401 %r imported but unused
F402 import %r from line %r shadowed by loop variable
F403 'from %s import *' used; unable to detect undefined names
F404 from __future__ imports must occur at the beginning of the file
F405 %r may be undefined, or defined from star imports: %s
F406 'from %s import *' only allowed at module level
F407 future feature %s is not defined
F501 '...' %% ... has invalid format string: %s
F502 '...' %% ... expected mapping but got sequence
F503 '...' %% ... expected sequence but got mapping
F504 '...' %% ... has unused named argument(s): %s
F505 '...' %% ... is missing argument(s) for placeholder(s): %s
F506 '...' %% ... has mixed positional and named placeholders
F507 '...' %% ... has %d placeholder(s) but %d substitution(s)
F508 '...' %% ... `*` specifier requires sequence
F509 '...' %% ... has unsupported format character %r
F521 '...'.format(...) has invalid format string: %s
F522 '...'.format(...) has unused named argument(s): %s
F523 '...'.format(...) has unused arguments at position(s): %s
F524 '...'.format(...) is missing argument(s) for placeholder(s): %s
F525 '...'.format(...) mixes automatic and manual numbering
F541 f-string is missing placeholders
F601 dictionary key %r repeated with different values
F602 dictionary key variable %s repeated with different values
F621 too many expressions in star-unpacking assignment
F622 two starred expressions in assignment
F631 assertion is always true, perhaps remove parentheses?
F632 use ==/!= to compare constant literals (str, bytes, int, float, tuple)
F633 use of >> is invalid with print function
F634 'if tuple literal' is always true, perhaps remove accidental comma?
F701 'break' outside loop
F702 'continue' not properly in loop
F703 'continue' not supported inside 'finally' clause
F704 'yield' outside function
F705 'return' with argument inside generator
F706 'return' outside function
F707 default 'except:' must be last
F721 syntax error in doctest
F722 syntax error in forward annotation %r
F723 syntax error in type comment %r
F811 redefinition of unused %r from line %r
F812 list comprehension redefines %r from line %r
F821 undefined name %r
F822 undefined name %r in __all__
F823 local variable %r {0} referenced before assignment
F831 duplicate argument %r in function definition
F841 local variable %r is assigned to but never used
F901 'raise NotImplemented' should be 'raise NotImplementedError'


The strictest and most opinionated python linter ever

WPS000 Internal error happened, see log. Please, take some time to report it
WPS100 Found wrong module name
WPS101 Found wrong module magic name
WPS102 Found incorrect module name pattern
WPS110 Found wrong variable name: {0}
WPS111 Found too short name: {0}
WPS112 Found private name pattern: {0}
WPS113 Found same alias import: {0}
WPS114 Found underscored number name pattern: {0}
WPS115 Found upper-case constant in a class: {0}
WPS116 Found consecutive underscores name: {0}
WPS117 Found name reserved for first argument: {0}
WPS118 Found too long name: {0}
WPS119 Found unicode name: {0}
WPS120 Found regular name with trailing underscore: {0}
WPS121 Found usage of a variable marked as unused: {0}
WPS122 Found all unused variables definition: {0}
WPS123 Found wrong unused variable name: {0}
WPS124 Found unreadable characters combination: {0}
WPS125 Found builtin shadowing: {0}
WPS200 Found module with high Jones Complexity score: {0}
WPS201 Found module with too many imports: {0}
WPS202 Found too many module members: {0}
WPS203 Found module with too many imported names: {0}
WPS204 Found overused expression: {0}
WPS210 Found too many local variables: {0}
WPS211 Found too many arguments: {0}
WPS212 Found too many return statements: {0}
WPS213 Found too many expressions: {0}
WPS214 Found too many methods: {0}
WPS215 Too many base classes: {0}
WPS216 Too many decorators: {0}
WPS217 Found too many await expressions: {0}
WPS218 Found too many `assert` statements: {0}
WPS219 Found too deep access level: {0}
WPS220 Found too deep nesting: {0}
WPS221 Found line with high Jones Complexity: {0}
WPS222 Found a condition with too much logic: {0}
WPS223 Found too many `elif` branches: {0}
WPS224 Found a comprehension with too many `for` statements
WPS225 Found too many `except` cases: {0}
WPS226 Found string literal over-use: {0}
WPS227 Found too long function output tuple: {0}
WPS228 Found too long compare
WPS229 Found too long ``try`` body length: {0}
WPS230 Found too many public instance attributes: {0}
WPS231 Found function with too much cognitive complexity: {0}
WPS232 Found module cognitive complexity that is too high: {0}
WPS233 Found call chain that is too long: {0}
WPS234 Found overly complex annotation: {0}
WPS235 Found too many imported names from a module: {0}
WPS236 Found too many variables used to unpack a tuple: {0}
WPS237 Found a too complex `f` string
WPS238 Found too many raises in a function: {0}
WPS300 Found local folder import
WPS301 Found dotted raw import: {0}
WPS302 Found unicode string prefix: {0}
WPS303 Found underscored number: {0}
WPS304 Found partial float: {0}
WPS305 Found `f` string
WPS306 Found class without a base class: {0}
WPS307 Found list comprehension with multiple `if`s
WPS308 Found constant comparison
WPS309 Found reversed compare order
WPS310 Found bad number suffix: {0}
WPS311 Found multiple `in` compares
WPS312 Found comparison of a variable to itself
WPS313 Found parenthesis immediately after a keyword
WPS314 Found conditional that always evaluates the same
WPS315 Found extra `object` in parent classes list
WPS316 Found context manager with too many assignments
WPS317 Found incorrect multi-line parameters
WPS318 Found extra indentation
WPS319 Found bracket in wrong position
WPS320 Found multi-line function type annotation
WPS321 Found uppercase string modifier: {0}
WPS322 Found incorrect multi-line string
WPS323 Found `%` string formatting
WPS324 Found inconsistent `return` statement
WPS325 Found inconsistent `yield` statement
WPS326 Found implicit string concatenation
WPS327 Found useless `continue` at the end of the loop
WPS328 Found useless node: {0}
WPS329 Found useless `except` case
WPS330 Found unnecessary operator: {0}
WPS331 Found variables that are only used for `return`: {0}
WPS332 Found walrus operator
WPS333 Found implicit complex compare
WPS334 Found reversed complex comparison
WPS335 Found incorrect `for` loop iter type
WPS336 Found explicit string concatenation
WPS337 Found multiline conditions
WPS338 Found incorrect order of methods in a class
WPS339 Found number with meaningless zeros: {0}
WPS340 Found exponent number with positive exponent: {0}
WPS341 Found wrong hex number case: {0}
WPS342 Found implicit raw string: {0}
WPS343 Found wrong complex number suffix: {0}
WPS344 Found explicit zero division
WPS345 Found meaningless number operation
WPS346 Found wrong operation sign
WPS347 Found vague import that may cause confusion: {0}
WPS348 Found a line that starts with a dot
WPS349 Found redundant subscript slice
WPS350 Found usable augmented assign pattern
WPS351 Found unnecessary literals
WPS352 Found multiline loop
WPS353 Found incorrect `yield from` target
WPS354 Found consecutive `yield` expressions
WPS355 Found an unnecessary blank line before a bracket
WPS356 Found an unnecessary iterable unpacking
WPS357 Found a ``\r`` (carriage return) line break
WPS358 Found a float zero (0.0)
WPS359 Found an iterable unpacking to list
WPS360 Found an unnecessary use of a raw string: {0}
WPS361 Found an inconsistently structured comprehension
WPS362 Found assignment to a subscript slice
WPS400 Found wrong magic comment: {0}
WPS401 Found wrong doc comment
WPS402 Found `noqa` comments overuse: {0}
WPS403 Found `no cover` comments overuse: {0}
WPS404 Found complex default value
WPS405 Found wrong `for` loop variable definition
WPS406 Found wrong context manager variable definition
WPS407 Found mutable module constant
WPS408 Found duplicate logical condition
WPS409 Found heterogeneous compare
WPS410 Found wrong metadata variable: {0}
WPS411 Found empty module
WPS412 Found `__init__.py` module with logic
WPS413 Found bad magic module function: {0}
WPS414 Found incorrect unpacking target
WPS415 Found duplicate exception: {0}
WPS416 Found `yield` inside comprehension
WPS417 Found non-unique item in hash: {0}
WPS418 Found exception inherited from `BaseException`
WPS419 Found `try`/`else`/`finally` with multiple return paths
WPS420 Found wrong keyword: {0}
WPS421 Found wrong function call: {0}
WPS422 Found future import: {0}
WPS423 Found raise NotImplemented
WPS424 Found except `BaseException`
WPS425 Found boolean non-keyword argument: {0}
WPS426 Found `lambda` in loop's body
WPS427 Found unreachable code
WPS428 Found statement that has no effect
WPS429 Found multiple assign targets
WPS430 Found nested function: {0}
WPS431 Found nested class: {0}
WPS432 Found magic number: {0}
WPS433 Found nested import
WPS434 Found reassigning variable to itself: {0}
WPS435 Found list multiply
WPS436 Found protected module import: {0}
WPS437 Found protected attribute usage: {0}
WPS438 Found `StopIteration` raising inside generator
WPS439 Found unicode escape in a binary string: {0}
WPS440 Found block variables overlap: {0}
WPS441 Found control variable used after block: {0}
WPS442 Found outer scope names shadowing: {0}
WPS443 Found unhashable item
WPS444 Found incorrect keyword condition
WPS445 Found incorrectly named keyword in the starred dict
WPS446 Found approximate constant: {0}
WPS447 Found alphabet as strings: {0}
WPS448 Found incorrect exception order
WPS449 Found float used as a key
WPS450 Found protected object import: {0}
WPS451 Found positional-only argument
WPS452 Found `break` or `continue` in `finally` block
WPS453 Found executable mismatch: {0}
WPS454 Found wrong `raise` exception type: {0}
WPS455 Found non-trivial expression as an argument for "except"
WPS456 Found "NaN" as argument to float()
WPS457 Found an infinite while loop
WPS458 Found imports collision: {0}
WPS459 Found comparison with float or complex number
WPS460 Found single element destructuring
WPS461 Forbidden inline ignore: {0}
WPS462 Wrong multiline string usage
WPS463 Found a getter without a return value
WPS464 Found empty comment
WPS465 Found likely bitwise and boolean operation mixup
WPS466 Found new-styled decorator
WPS467 Found bare raise keyword
WPS468 Found redundant use of `enumerate`
WPS469 Found error raising from itself
WPS470 Found kwarg unpacking in class definition
WPS471 Found consecutive slices
WPS472 Found unpacking used to get a single element from a collection
WPS500 Found `else` in a loop without `break`
WPS501 Found `finally` in `try` block without `except`
WPS502 Found simplifiable `if` condition
WPS503 Found useless returning `else` statement
WPS504 Found negated condition
WPS505 Found nested `try` block
WPS506 Found useless lambda declaration
WPS507 Found useless `len()` compare
WPS508 Found incorrect `not` with compare usage
WPS509 Found incorrectly nested ternary
WPS510 Found `in` used with a non-set container
WPS511 Found separate `isinstance` calls that can be merged for: {0}
WPS512 Found `isinstance` call with a single element tuple
WPS513 Found implicit `elif` condition
WPS514 Found implicit `in` condition
WPS515 Found `open()` used without a context manager
WPS516 Found `type()` used to compare types
WPS517 Found pointless starred expression
WPS518 Found implicit `enumerate()` call
WPS519 Found implicit `sum()` call
WPS520 Found compare with falsy constant
WPS521 Found wrong `is` compare
WPS522 Found implicit primitive in a form of `lambda`
WPS523 Found incorrectly swapped variables
WPS524 Found self assignment with refactored assignment
WPS525 Found wrong `in` compare with single item container
WPS526 Found implicit `yield from` usage
WPS527 Found not a tuple used as an argument
WPS528 Found implicit `.items()` usage
WPS529 Found implicit `.get()` dict usage
WPS530 Found implicit negative index
WPS531 Found simplifiable returning `if` condition in a function
WPS600 Found subclassing a builtin: {0}
WPS601 Found shadowed class attribute: {0}
WPS602 Found using `@staticmethod`
WPS603 Found using restricted magic method: {0}
WPS604 Found incorrect node inside `class` body
WPS605 Found method without arguments: {0}
WPS606 Found incorrect base class
WPS607 Found incorrect `__slots__` syntax
WPS608 Found incorrect `super()` call: {0}
WPS609 Found direct magic attribute usage: {0}
WPS610 Found forbidden `async` magic method usage: {0}
WPS611 Found forbidden `yield` magic method usage
WPS612 Found useless overwritten method: {0}
WPS613 Found incorrect `super()` call context: incorrect name access
WPS614 Found descriptor applied on a function
WPS615 Found unpythonic getter or setter