wemake-python-styleguide v0.14.0 Release Notes
Release Date: 2020-03-22 // about 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!๐ Features
- ๐ฅ Breaking : removes
flake8-executable
, now usingWPS452
instead ofEXE001..EXE005
- ๐ฅ Breaking : removes
flake8-print
, now usingWPS421
instead ofT001
- ๐ฅ Breaking : removes
flake8-builtins
, now usingWPS125
instead ofA001..A005
- ๐ฅ Breaking : removes
flake8-annotations-complexity
,
now usingWPS234
instead ofTAE002
- ๐ฅ Breaking : removes
flake8-pep3101
, now usingWPS323
instead ofS001
,
we also use a new logic for this violation:
we check string defs for%
patterns, and not for%
operator - ๐ฅ Breaking :
WPS441
is no longer triggered forexcept
blocks,
it is now handled byF821
fromflake8
- ๐ฅ Breaking : removes
radon
,
becausecognitive-complexity
andmccabe
is enough - ๐ฅ Breaking : removes
flake8-loggin-format
as a direct dependency - ๐ฅ Breaking : removes
ImplicitTernaryViolation
orWPS332
,
๐ because it has too many false positives #1099 - โ Removes
flake8-coding
, all encoding strings, visitor and tests
for oldWPS323
which is now reused for modulo formatting checks - โ Adds
python3.8
support - ๐
Changes
styleguide.toml
andflake8.toml
scripts definition - ๐
Extracts new violation -
WPS450
fromWPS436
#1118 - โ Adds domain names options:
--allowed-domain-names
and--forbidden-domain-names
,
๐ that are used to create variable names' blacklist #1106 - ๐
Forbids to use
\r
(carriage return) as line breaks in strings #1111 - Forbids to use
:=
operator, it now reusesWPS332
code - Forbids to use positional only
/
arguments - Forbids to have too many names imported from a single
from ... import
- Forbids to use
continue
andbreak
infinally
- โฌ๏ธ Forbids to use
__reduce__
and__reduce_ex__
magic methods - Adds
__call__
to list of methods that should be on top #1125 - ๐ Allows
_
to be now used as a defined variable - โ Removes
cognitive_complexity
dependency, now it is built in into our linter - โ Adds baseline information for all complexity violation messages:
x > baseline
- ๐ Changes how cognitive complexity is calculated
- โ Adds support for positional arguments in different checks
- โ Adds
UnreadableNameViolation
asWPS124
because there are some
character combination which is not easy to read - โ Adds support for
NamedExpr
with in compare type violation
๐ Bugfixes
- Fixes how
i_control_code
behaves withWPS113
- ๐ Fixes that cognitive complexity was ignoring
ast.Continue
,ast.Break
, andast.Raise
statements - ๐ Fixes that cognitive complexity was ignoring
ast.AsyncFor
loops - ๐ Fixes that annotation complexity was not reported for
async
functions - ๐ Fixes that annotation complexity was not reported for lists
- ๐ Fixes that annotation complexity was not reported for
*
and/
args - ๐ Fixes that annotation complexity was not tested for dot notation attributes
- ๐ Fixes that annotation complexity fails on string expressions
- ๐ Fixes bug when
TooManyPublicAttributesViolation
was counting duplicate fields - ๐ Fixes negated conditions
WPS504
was not reported forif
expressions - ๐ Fixes that
import dumps
was reported asWPS347
,
now onlyfrom ... import dumps
is checked - ๐ Fixes that
from some import a as std
was reported as a vague import
withWPS347
despite having a meaningful alias - ๐ Fixes that
WPS501
was reported for@contextmanager
definition - ๐ Fixes
WPS226
to be thrown at nested string type annotations - ๐ Fixes
WPS204
reported simplest nodes as overused like[]
andcall()
- ๐ Fixes
WPS204
not reporting overusedf
strings - ๐ Fixes
WPS204
reporting overused return type annotations - ๐ Fixes
WPS204
reportingself.
attribute access - ๐ Fixes
WPS331
reporting cases that do require some extra steps before return - ๐ Fixes
WPS612
not reporingsuper()
calls without return - ๐ Fixes
WPS404
not raising on wrong*
and/
defaults - ๐ Fixes
WPS425
raising on.get
,getattr
,setattr
,
and other builtin functions without keyword arguments - ๐ Fixes
WPS221
reporting differently on differentpython
versions - ๐ Fixes
WPS221
reporting nested variable annotations - ๐ Fixes
WPS509
not reporting nested ternary in grandchildren ofif
- ๐ Fixes
WPS509
not reporting nested ternary in ternary - ๐ Fixes
WPS426
not reporting nestedlambda
in comprehensions - ๐ Fixes several violations to reporting for
ast.Bytes
andast.FormattedStr
whereast.Str
was checked - ๐ Fixes
WPS601
reporting shadowing for non-self
attributes - ๐ Fixes
WPS114
not to be so strict - ๐ Fixes
WPS122
not raising forfor
andasync for
definitions - ๐ Fixes
WPS400
raising for# type: ignore[override]
comments - ๐ Fixes
WPS115
not raising for attributes inside other nodes
Misc
- ๐ Changes how tests are executed
- ๐ Changes how coverage is calculated, adds
coverage-conditional-plugin
- โ Adds how a violation can be deprecated
- ๐ Improves old visitor tests with
/
argument cases - ๐ Improves old visitor tests with
:=
cases - โ Adds
local-partial-types
to mypy config - ๐
Uses
abc
stdlib's module to mark abstract base classes #1122 - โ Adds
python3.8
to the CI - โก๏ธ Updates a lot of dependencies
- ๐ฅ Breaking : removes