Releases: wemake-services/wemake-python-styleguide
Releases · wemake-services/wemake-python-styleguide
Version 0.19.2
Bugfixes
- Fixes
WrongEmptyLinesCountViolation
crash onCallable[..., ...]
#2899
Version 0.19.1
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.
Bugfixes
- Fixes
TooDeepNestingViolation
not to trigger
on...
in functions and classes - Fixes
StatementHasNoEffectViolation
not to trigger
on...
in functions and classes, when it is the only node
Version 0.19.0
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
.
Features
- Adds official
python3.12
support - Breaking: drops
python3.8
support - Breaking: Reconsider
object
required base class exception:
sinceclass Klass[_Type]
must not containobject
,
this rule is change to be the opposite:
object
explicit base class must not be used.
You can useruff
to change allobject
-based types to the new style:
ruff check --select=UP004 --fix .
https://docs.astral.sh/ruff/rules/useless-object-inheritance/ - Breaking: allow positional-only parameters,
since it is required bymypy
when usingConcatenate
- Adds support for naming rules for PEP695 type params
- Due to how
f
-string are parsed inpython3.12
several token-based
violations are not reported anymore for them:
WrongMultilineStringViolation
,ImplicitRawStringViolation
,
WrongUnicodeEscapeViolation
,RawStringNotNeededViolation
wemake
output formatter now respectsNO_COLOR=1
option
to disable text highlighting. See https://no-color.org- Adds
ImportObjectCollisionViolation
to detect
the same objects imported under different aliases - Adds
reveal_locals
to the list of forbidden functions - Updates
flake8
to7.x
Bugfixes
- Fixes
ForbiddenInlineIgnoreViolation
config parsing. #2590 - Fixes
WrongEmptyLinesCountViolation
for func definitions with ellipsis. #2847 - Fixes
WrongEmptyLinesCountViolation
for multiline implicit string concatination. #2787 - Fixes
ObjectInBaseClassesListViolation
,UnpythonicGetterSetterViolation
,
ImplicitInConditionViolation
,RedundantSubscriptViolation
,
TooLongCompareViolation
to include better error details - Fixes
TooDeepNestingViolation
forTryStar
andMatch
statements - Fixes
TooLongTryBodyViolation
andTooManyExceptCasesViolation
to work forTryStar
statements as well - Fixes
UselessNodeViolation
to work withTryStar
- Fixes
DuplicateExceptionViolation
to work withTryStar
- Fixes
TryExceptMultipleReturnPathViolation
to work withTryStar
- Fixes
IncorrectExceptOrderViolation
to work withTryStar
- Fixes that
MatchStar
was not checked in pattern matching name assignments - Fixes pattern matching support
inBlockAndLocalOverlapViolation
andOuterScopeShadowingViolation
Misc
- Updates multiple
flake8-*
dependencies - Fixes multiple typos in docs
Version 0.18.0
Features
- Breaking: drops
python3.7
support, because it has almost reached its EOL - Adds
python3.11
support - Bump
flake8
to version5.x
- Bump
flake8-*
dependencies to newer versions - Added
ChainedIsViolation
#2443 - Added
BuggySuperContextViolation
#2310
Bugfixes
- Make
generic_visit()
check script properly handlewith
statements. - Allow calling magic methods with the same name as the enclosing method #2381
- Fix WrongEmptyLinesCountViolation false positive #2531
- Fix OpenWithoutContextManagerViolation false positive #2577
Misc
- Replaced
flakehell
mentions toflakeheaven
#2409
Version 0.17.0
Features
- Breaking: drops
python3.6
support - Adds support for pattern matching naming rules, same as other variables
- Adds
--show-violation-links
option to show links to violation docs - Adds
__init_subclass__
in the beginning of accepted methods
order as per WPS338 #2411 - Adds
WrongEmptyLinesCountViolation
to check
for too many lines in functions and methods definitions #2486
Bugfixes
- Fixes
WPS226
false positives on|
use inSomeType | AnotherType
type hints syntax - Now
-1
is not reported to be an overused expression - Allow
__aiter__
to be async iterator - Adds violation method name to error message of
YieldMagicMethodViolation
- Fixes direct docker image invocation #2492
Misc
Version 0.16.1
Version 0.16.0
Features
- Supports new
flake8
version4.x
- Now
InconsistentYieldViolation
andInconsistentReturnViolation
are raised
whenyield
orreturn
is used withNone
where plain version should be used #2151 - Dot
'.'
and comma','
do not count against string literal overuse limit anymore #2209 - Added
RedundantEnumerateViolation
#1825 - Adds
RaiseFromItselfViolation
#2133 - Adds
ConsecutiveSlicesViolation
#2064 - Adds
KwargsUnpackingInClassDefinitionViolation
#1754 DirectMagicAttributeAccessViolation
now only flags instances for which
a known alternative exists #2268- Forbids getting collection element of list by unpacking #1824
- Now
WPS227
forbids returning tuples that are too long #1731
Bugfixes
- Fixes that
InconsistentComprehensionViolation
was ignoring
misalignedin
expressions #2075 - Fixes some common magic methods not being recognized as such #2281
Misc
- Removes all
Raises:
from docstrings, they were unused - Improve Docs: Fixed all typos and grammatical errors in
CHANGELOG.md
- Updated documentation with the recommended
isort
config. #1934 - Updates
typing_extensions
to4.x
Version 0.15.3
Bugfixes
- Fixes crash on
python3.10
- Fixes
UselessReturningElseViolation
to not reportelse
withbreak
#1958 - Fixes
ReassigningVariableToItselfViolation
to not report onx = (x,)
#1807 - Fixes
ReassigningVariableToItselfViolation
to extract variables
from unary operators #1874 - Fixes that
f'{some:,}'
was considered too complex #1921 - Fixes that
range(len(x))
was not allowed even outsidefor
loops #1883
Misc
- Adds documentation (and tests) for how to run project on Jupyter Notebooks
- Updates
mypy
to0.902
and fixes type issues
Version 0.15.2
Bugfixes
- Fixes
BitwiseAndBooleanMixupViolation
work with PEP 604 union types #1884 - Fixes
CognitiveModuleComplexityViolation
to not trigger
for a single-item modules - Fixes that
ConstantConditionViolation
was not reported for aBoolOp
- Functions and methods marked as
@overload
or@typing.overload
do not count in complexity rules
Misc
- Updates GitHub Action's base Python image version to
3.8.8
Version 0.15.1
Bugfixes
- Fixes
dataclasses
import, it was failing onpython3.6
- Fixes
InconsistentComprehensionViolation
work withasync
comprehensions - Fixes nested compehensions support for
InconsistentComprehensionViolation
- Fixes multiple
if
support forInconsistentComprehensionViolation
- Fixes that
NestedTernaryViolation
was not reported for a comprehension - Fixes that
ConstantConditionViolation
was not reported for a comprehension - Fixes that
ConstantConditionViolation
was triggering forwhile x := True:
- Fixes that
UselessElseViolation
was not reported
forfor
,while
, andtry
keywords - Fixes false positive
InfiniteWhileLoopViolation
fortry
#1857 - Fixes that
InfiniteWhileLoopViolation
was not triggered on1
or other truthy nodes
Misc
- Refactors how
tokenize
tests are executed,
now we have an option to compile fixture code
to make sure it is syntatically valid