The strictest and most opinionated python linter ever!
This release fixes how ...
is used. For example, it is common to define
function stubs / protocols like this:
def some_function(): ...
Now, ...
will be excluded from several rules.
TooDeepNestingViolation
not to trigger
on ...
in functions and classesStatementHasNoEffectViolation
not to trigger
on ...
in functions and classes, when it is the only nodeThis minor version will be the last release with all the flake8
plugins.
In the future this project will be migrated to be used together with ruff
.
python3.12
supportpython3.8
supportobject
required base class exception:
since class Klass[_Type]
must not contain object
,
this rule is change to be the opposite:
object
explicit base class must not be used.
You can use ruff
to change all object
-based types to the new style:
ruff check --select=UP004 --fix .
https://docs.astral.sh/ruff/rules/useless-object-inheritance/
mypy
when using Concatenate
f
-string are parsed in python3.12
several token-based
violations are not reported anymore for them:
WrongMultilineStringViolation
, ImplicitRawStringViolation
,
WrongUnicodeEscapeViolation
, RawStringNotNeededViolation
wemake
output formatter now respects NO_COLOR=1
option
to disable text highlighting. See https://no-color.org
ImportObjectCollisionViolation
to detect
the same objects imported under different aliasesreveal_locals
to the list of forbidden functionsflake8
to 7.x
ForbiddenInlineIgnoreViolation
config parsing. #2590WrongEmptyLinesCountViolation
for func definitions with ellipsis. #2847WrongEmptyLinesCountViolation
for multiline implicit string concatination. #2787ObjectInBaseClassesListViolation
, UnpythonicGetterSetterViolation
,
ImplicitInConditionViolation
, RedundantSubscriptViolation
,
TooLongCompareViolation
to include better error detailsTooDeepNestingViolation
for TryStar
and Match
statementsTooLongTryBodyViolation
and TooManyExceptCasesViolation
to work for TryStar
statements as wellUselessNodeViolation
to work with TryStar
DuplicateExceptionViolation
to work with TryStar
TryExceptMultipleReturnPathViolation
to work with TryStar
IncorrectExceptOrderViolation
to work with TryStar
MatchStar
was not checked in pattern matching name assignmentsBlockAndLocalOverlapViolation
and OuterScopeShadowingViolation
flake8-*
dependenciespython3.7
support, because it has almost reached its EOLpython3.11
supportflake8
to version 5.x
flake8-*
dependencies to newer versionsChainedIsViolation
#2443BuggySuperContextViolation
#2310generic_visit()
check script properly handle with
statements.flakehell
mentions to flakeheaven
#2409python3.6
support--show-violation-links
option to show links to violation docs__init_subclass__
in the beginning of accepted methods
order as per WPS338 #2411WrongEmptyLinesCountViolation
to check
for too many lines in functions and methods definitions #2486WPS226
false positives on |
use in SomeType | AnotherType
type hints syntax-1
is not reported to be an overused expression__aiter__
to be async iteratorYieldMagicMethodViolation
BaseViolation.full_code
#2409max-string-usages
and enforced rule #2456wemake-python-stylegui.de
to wemake-python-styleguide.rtfd.io
flake8
version 4.x
InconsistentYieldViolation
and InconsistentReturnViolation
are raised
when yield
or return
is used with None
where plain version should be used #2151'.'
and comma ','
do not count against string literal overuse limit anymore #2209RedundantEnumerateViolation
#1825RaiseFromItselfViolation
#2133ConsecutiveSlicesViolation
#2064KwargsUnpackingInClassDefinitionViolation
#1754DirectMagicAttributeAccessViolation
now only flags instances for which
a known alternative exists #2268WPS227
forbids returning tuples that are too long #1731InconsistentComprehensionViolation
was ignoring
misaligned in
expressions #2075Raises:
from docstrings, they were unusedCHANGELOG.md
isort
config. #1934typing_extensions
to 4.x
python3.10
UselessReturningElseViolation
to not report else
with break
#1958ReassigningVariableToItselfViolation
to not report on x = (x,)
#1807ReassigningVariableToItselfViolation
to extract variables
from unary operators #1874f'{some:,}'
was considered too complex #1921range(len(x))
was not allowed even outside for
loops #1883mypy
to 0.902
and fixes type issuesBitwiseAndBooleanMixupViolation
work with PEP 604 union types #1884CognitiveModuleComplexityViolation
to not trigger
for a single-item modulesConstantConditionViolation
was not reported for a BoolOp
@overload
or @typing.overload
do not count in complexity rules3.8.8
dataclasses
import, it was failing on python3.6
InconsistentComprehensionViolation
work with async
comprehensionsInconsistentComprehensionViolation
if
support for InconsistentComprehensionViolation
NestedTernaryViolation
was not reported for a comprehensionConstantConditionViolation
was not reported for a comprehensionConstantConditionViolation
was triggering for while x := True:
UselessElseViolation
was not reported
for for
, while
, and try
keywordsInfiniteWhileLoopViolation
for try
#1857InfiniteWhileLoopViolation
was not triggered on 1
or other truthy nodestokenize
tests are executed,
now we have an option to compile fixture code
to make sure it is syntatically valid