The strictest and most opinionated python linter ever!
MIT License
Bot releases are hidden (Show)
WrongEmptyLinesCountViolation
crash on Callable[..., ...]
#2899Published by sobolevn 7 months ago
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...
in functions and classesStatementHasNoEffectViolation
not to trigger...
in functions and classes, when it is the only nodePublished by sobolevn 7 months ago
This 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:class Klass[_Type]
must not contain object
,object
explicit base class must not be used.ruff
to change all object
-based types to the new style:ruff check --select=UP004 --fix .
mypy
when using Concatenate
f
-string are parsed in python3.12
several token-basedWrongMultilineStringViolation
, ImplicitRawStringViolation
,WrongUnicodeEscapeViolation
, RawStringNotNeededViolation
wemake
output formatter now respects NO_COLOR=1
optionImportObjectCollisionViolation
to detectreveal_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
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-*
dependenciesPublished by sobolevn over 1 year ago
python3.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
#2409Published by sobolevn about 2 years ago
python3.6
support--show-violation-links
option to show links to violation docs__init_subclass__
in the beginning of accepted methodsWrongEmptyLinesCountViolation
to checkWPS226
false positives on |
use in SomeType | AnotherType
-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
wemake-python-styleguide.rtfd.io
Published by sobolevn over 2 years ago
'Literal["raise"]'
annotation #2341WPS471
was not detected on complex assignment targets #2301flake8-bandit
and bandit
version conflict #2368Published by sobolevn almost 3 years ago
flake8
version 4.x
InconsistentYieldViolation
and InconsistentReturnViolation
are raisedyield
or return
is used with None
'.'
and comma ','
do not count against string literal overuse limit anymore #2209RedundantEnumerateViolation
#1825RaiseFromItselfViolation
#2133ConsecutiveSlicesViolation
#2064KwargsUnpackingInClassDefinitionViolation
#1754DirectMagicAttributeAccessViolation
now only flags instances for whichWPS227
forbids returning tuples that are too long #1731InconsistentComprehensionViolation
was ignoringin
expressions #2075Raises:
from docstrings, they were unusedCHANGELOG.md
isort
config. #1934typing_extensions
to 4.x
Published by sobolevn over 3 years ago
python3.10
UselessReturningElseViolation
to not report else
with break
#1958ReassigningVariableToItselfViolation
to not report on x = (x,)
#1807ReassigningVariableToItselfViolation
to extract variablesf'{some:,}'
was considered too complex #1921range(len(x))
was not allowed even outside for
loops #1883mypy
to 0.902
and fixes type issuesPublished by sobolevn over 3 years ago
BitwiseAndBooleanMixupViolation
work with PEP 604 union types #1884CognitiveModuleComplexityViolation
to not triggerConstantConditionViolation
was not reported for a BoolOp
@overload
or @typing.overload
3.8.8
Published by sobolevn over 3 years ago
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 reportedfor
, while
, and try
keywordsInfiniteWhileLoopViolation
for try
#1857InfiniteWhileLoopViolation
was not triggered on 1
tokenize
tests are executed,Published by sobolevn over 3 years ago
python3.9
supportpython3.9
self
/cls
/mcs
,point.x = 1
will not trigger any violations.except
float("NaN")
.__call__
method to be asynchronousreturn None
__await__
to the list of priority magic methods0.0
)raise Exception
and raise BaseException
%
with zero as the divisorr''
when not necessaryf
-stringsraise
statements inside a single functionfloat
and complex
valuesget_
get_attribute
or set_attribute
credits
, license
, and copyright
builtins are free to shadowLiteral[""]
WPS110
__mro__
, __subclasses__
and __version__
WPS326
work when there is comment between string literals^
with 1
lambda
in loop uses only its argumentspprint.pprint
_
to declare several unused variables,x, _, _ = coordinates()
*'abc'
was not counted as pointless star expression-some
was counted as overused expressionself.generic_visit(node)
in AST visitorspoetry
version to 1.1
reviewdog
version to 0.11.0
and adds action-depup
Published by sobolevn about 4 years ago
isort@5
compatibilityPublished by sobolevn over 4 years ago
This release was focused on adding python3.8
support,
removing dependencies that can be removed, and fixing bugs.
There are breaking changes ahead!
We also have this nice migration guide.
One more thing: flake8
still fails on :=
operator.
And there's nothing we can do about it.
Please, be patient – this linter does not allow to have :=
in the source code anyway!
flake8-executable
, now using WPS452
instead of EXE001..EXE005
flake8-print
, now using WPS421
instead of T001
flake8-builtins
, now using WPS125
instead of A001..A005
flake8-annotations-complexity
,WPS234
instead of TAE002
flake8-pep3101
, now using WPS323
instead of S001
,%
patterns, and not for %
operatorWPS441
is no longer triggered for except
blocks,F821
from flake8
radon
,cognitive-complexity
and mccabe
is enoughflake8-loggin-format
as a direct dependencyImplicitTernaryViolation
or WPS332
,flake8-coding
, all encoding strings, visitor and testsWPS323
which is now reused for modulo formatting checkspython3.8
supportstyleguide.toml
and flake8.toml
scripts definitionWPS450
from WPS436
#1118--allowed-domain-names
and --forbidden-domain-names
,\r
(carriage return) as line breaks in strings #1111:=
operator, it now reuses WPS332
code/
argumentsfrom ... import
continue
and break
in finally
__reduce__
and __reduce_ex__
magic methods__call__
to list of methods that should be on top #1125_
to be now used as a defined variablecognitive_complexity
dependency, now it is built in into our linterx > baseline
UnreadableNameViolation
as WPS124
because there are someNamedExpr
with in compare type violationi_control_code
behaves with WPS113
ast.Continue
, ast.Break
, and ast.Raise
statementsast.AsyncFor
loopsasync
functions*
and /
argsTooManyPublicAttributesViolation
WPS504
was not reported for if
expressionsimport dumps
was reported as WPS347
,from ... import dumps
is checkedfrom some import a as std
was reported as a vague importWPS347
despite having a meaningful aliasWPS501
was reported for @contextmanager
definitionWPS226
to be thrown at nested string type annotationsWPS204
reported simplest nodes as overused like []
and call()
WPS204
not reporting overused f
stringsWPS204
reporting overused return type annotationsWPS204
reporting self.
attribute accessWPS331
reporting cases that do require some extra steps before returnWPS612
not reporing super()
calls without returnWPS404
not raising on wrong *
and /
defaultsWPS425
raising on .get
, getattr
, setattr
,WPS221
reporting differently on different python
versionsWPS221
reporting nested variable annotationsWPS509
not reporting nested ternary in grandchildren of if
WPS509
not reporting nested ternary in ternaryWPS426
not reporting nested lambda
in comprehensionsast.Bytes
and ast.FormattedStr
ast.Str
was checkedWPS601
reporting shadowing for non-self
attributesWPS114
not to be so strictWPS122
not raising for for
and async for
definitionsWPS400
raising for # type: ignore[override]
commentsWPS115
not raising for attributes inside other nodescoverage-conditional-plugin
/
argument cases:=
caseslocal-partial-types
to mypy configabc
stdlib's module to mark abstract base classes #1122python3.8
to the CIPublished by sobolevn over 4 years ago
This is the last 0.13.x
supporting release,
we have to concentrate on python3.8
support
and 0.14.0
which will introduce it to the public.
flake8-pep3101
flake8-builtins
flake8-eradicate
hypothesis
-based testsflakehell
base configflakehell
docsMAX_NOQA_COMMENTS
and related violation docsOverusedExpressionViolation
and TooManyExpressionsViolation
docsPublished by sobolevn almost 5 years ago
radon
versionpoetry
version to 1.0
Published by sobolevn almost 5 years ago
NegatedConditionsViolation
false positive on absentelse
in combination with elif
WPS528
false positive on augmented assignsWPS349
reviewdog
was not able to create more than 30
comments per PRpylint
docs fixedyield
violationPublished by sobolevn almost 5 years ago
_
was marked as invalid by VagueImportViolation
VagueImportViolation
were misleadingBracketBlankLineViolation
#1020ParametersIndentationViolation
#1021Published by sobolevn almost 5 years ago
This is a huge release that was created during the Hactoberfest season.
It would have been impossible without the huge help from our awesome contributors. Thanks a lot to everyone!
This release is not focused on any particular area.
It features a lot of new rules from different categories.
cognitive_complexity
darglint
pep8-naming
and flake8-comprehensions
WPS431
now allow customize whitelist via nested-classes-whitelist
setting**{'@': 1}
lambda: 0
from json import loads
)OveruseOfNoqaCommentViolation
configurable via --max-noqa-comments
[0:7]
or [3:None]
)super()
as a valid overused expressionsuper()
with other methods and propertiesWPS350
enforces using augmented assign patternWPS525
forbids comparisons where in
is compared with single item containerfor
and while
statementsWPS113
now can be tweaked with I_CONTROL_CODE
settingWPS000
that indicates internal errorsyield from
.
&
, |
, >>
, <<
, ^
operators usageWPS444
works, now we use stricter logic for while
and assert
yield from
with incorrect typesyield
expressions.items()
in loops.get()
over key in dict
checksfloat
keys in arrays and dictionariesa[len(a) - 1]
because it is just a[-1]
foo(a)(b)(c)(d)
ImplicitElifViolation
false positives on a specific edge cases--i-control-code
setting for BadMagicModuleFunctionViolation
3.8.x
not not True
was not detected as WPS330
MisrefactoredAssignmentViolation
checkWrongMagicCommentViolation
not catching certain wrong commentsBadMagicModuleFunctionViolation
false positives on class-level methodsInconsistentReturnViolation
false positives on nested functions--i-dont-control-code
was not present in command line optionsBlockVariableVisitor
false positives on a properties//
was not recognised as a math operationBlockAndLocalOverlapViolation
on annotations without value assignx and not x
was not detected as the similar conditions by WPS408
1.0
and 0.1
were treated as magic numbersscripts/tokens.py
and scripts/parse.py
with external tools.. versionchanged
and previous_codes
propertiesisort
settings requirement for compliance with WSP318
in docstringPublished by sobolevn about 5 years ago
@overload
from BlockAndLocalOverlapViolation
my_var = do_some(my_var)
Published by sobolevn about 5 years ago
nitpick
colors and new files APIflake8-docstrings