The strictest and most opinionated python linter ever!
python3.9
supportpython3.9
self
/cls
/mcs
,
but not any other ones.
So, now writting point.x = 1
will not trigger any violations.
Previously, it would raise "too short name".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,
like: 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
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
,
now using WPS234
instead of TAE002
flake8-pep3101
, now using WPS323
instead of S001
,
we also use a new logic for this violation:
we check string defs for %
patterns, and not for %
operatorWPS441
is no longer triggered for except
blocks,
it is now handled by F821
from flake8
radon
,
because cognitive-complexity
and mccabe
is enoughflake8-loggin-format
as a direct dependencyImplicitTernaryViolation
or WPS332
,
because it has too many false positives #1099flake8-coding
, all encoding strings, visitor and tests
for old WPS323
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
,
that are used to create variable names' blacklist #1106\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 some
character combination which is not easy to readNamedExpr
with in compare type violationi_control_code
behaves with WPS113
ast.Continue
, ast.Break
, and ast.Raise
statementsast.AsyncFor
loopsasync
functions*
and /
argsTooManyPublicAttributesViolation
was counting duplicate fieldsWPS504
was not reported for if
expressionsimport dumps
was reported as WPS347
,
now only from ... import dumps
is checkedfrom some import a as std
was reported as a vague import
with WPS347
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
,
and other builtin functions without keyword argumentsWPS221
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
where 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 CIThis 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
docsNegatedConditionsViolation
false positive on absent
else
in combination with elif
WPS528
false positive on augmented assignsWPS349
reviewdog
was not able to create more than 30
comments per PRpylint
docs fixedyield
violation_
was marked as invalid by VagueImportViolation
VagueImportViolation
were misleadingBracketBlankLineViolation
#1020ParametersIndentationViolation
#1021This 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 docstring@overload
from BlockAndLocalOverlapViolation
my_var = do_some(my_var)