Releases: wemake-services/wemake-python-styleguide
1.6.1
Bugfixes
- Fixes false positive
WPS366allowing the use
of a single constant inor, #3610 - Fixes the false positive
WPS330when alternating unary operators, #3594
Docs
- Update docs to reflect removed config knob by @Maroloccio in #3612
New Contributors
- @Maroloccio made their first contribution in #3612
Full Changelog: 1.6.0...1.6.1
Version 1.6.0
Features
- Adds
python3.14official support - Allows walrus operator in
WPS332, #3505 - Forbids symmetric bitwise operations in
WPS345, #3593 - Adds
WPS366: forbid meaningless boolean operations, #3593 - Forbids complex f-string format specifiers in
WPS237, #3491
Bugfixes
- Fixes false positive
WPS457forwhile Trueloop
withawaitexpressions, #3753 - Fixes the false positive
WPS617by assigning a function
that receives a lambda expression as a parameter, #3597 - Fixes false positive
WPS430for whitelisted nested functions, #3589 - Fixes false positive
WPS457forwhile Truenested intry/except, #3604
Removals
- Breaking: Removes
WPS354, because it is inconsistent
with async code, #3601
New Contributors
- @j2cry made their first contribution in #3592
- @catstyle1101 made their first contribution in #3597
- @albertedwardson made their first contribution in #3591
- @stakeswky made their first contribution in #3604
Full Changelog: 1.5.0...1.6.0
Version 1.5.0
Features
- Adds
WPS481: for statement not allowed in class and module scopes, #3520 - Allows
/string inWPS226, #3554 - Adds
WPS365: match statement can be simplified toif, #3520 - Allow re-exports in
WPS201, #3570
Bugfixes
- Fixes
WPS226false-positive on fstring parts, #3548 - Fixes false positive
WPS412with docstring and imports in__init__.py, #3569
Misc
- Improves docs: remove outdated AST online visualisation tool url
- Returns
[tool.poetry]instead of[project]inpyproject.toml
New Contributors
- @djeada made their first contribution in #3516
- @ZhdanovAM72 made their first contribution in #3526
- @Sehat1137 made their first contribution in #3537
- @F0RRZZ made their first contribution in #3551
- @stefan-vasilenko made their first contribution in #3555
- @vldmrdev made their first contribution in #3575
Full Changelog: 1.4.0...1.5.0
Version 1.4.0
Features
- Allows
__init__.pyfiles that consist only of imports, #3486 - Adds
--max-conditionsoption, #3493 - Adds
--known-enum-basesoption to support custom enum-like base classes, #3513
Misc
- Adds custom Sphinx directive
.. plugincodesfor violation rendering, #1318 - Adds violation classes filter for docs rendering, #3490
New Contributors
- @makridenko made their first contribution in #3495
- @Evgenmater made their first contribution in #3499
Full Changelog: 1.3.0...1.4.0
Version 1.3.0
Features
- Adds more names to
WPS110:spam,ham,tmp,temp,arr
Bugfixes
- Fixes
WPS243to use number of statements infinallybody
instead of a number of lines, #3458
1.2.0
Main changes
Due to PEP-695, it's now allowed
to use [] in decorators only for python3.12+.
@MyClassDecorator[T, V]
def some_function(): ...Features
- Adds
WPS243: forbids complexfinallybodies, #3458 - Adds
WPS478: forbids using non strict slice operations, #1011 - Adds
WPS479: forbids using multiline fstrings, #3405 - Adds
WPS480: forbids using comments inside formatted string, #3404
Bugfixes
- Removes unnecessary
WPS604andWPS614rules from thenoqa.py, #3420 - Fixes
WPS115false-positive onStrEnum,IntEnum,IntFlagattributes, #3381 - Fixes
WPS432, now it ignores magic numbers inLiteral, #3397 - Fixes
WPS466for generic type specificationsMyClassDecorator[T], #3417 - Fixes
WPS212to ignore nested classes and functions
when countingreturnstatements, #3413 - Improves
WPS349highlighting, #3437
New Contributors
- @LordGvozd made their first contribution in #3362
- @NikitaSemenovAiforia made their first contribution in #3382
- @wjqsm made their first contribution in #3403
- @mkaraev made their first contribution in #3411
- @joscha made their first contribution in #3421
- @MIXgleb made their first contribution in #3423
- @dgtrv made their first contribution in #3431
- @alexeev-prog made their first contribution in #3461
Full Changelog: 1.1.0...1.2.0
Version 1.1.0 with `wps explain` CLI
Command line utility
This version introduces wps CLI tool.
wps explain <code> command can be used to access WPS
violation docs (same as on website) but without any internet access.
Features
- Adds
WPS476: forbids to useawaitexpressions inforloops, #1600 - Adds
WPS477: forbidsTypeVarTupleafter aTypeVarwith a default, #3265
Bugfixes
- Fixes
WPS115false-positive onEnumattributes, #3238 - Removes duplicated
WPS312, #3239 - Fixes
WPS432, now it shows literal num, #1402 - Fixes
WPS226, now it points to the first string literal occurrence, #3267 - Fixes
WPS605false-positive on@staticmethod, #3292 - Fixes
_SELFname not to triggerWPS117, #3310 - Fixes
WPS221being too strict with f-strings, #3350
Version 1.0.0 with full `ruff` support
Ruff
This release introduces the new main concept: ruff compatibility.
Now WPS is the only flake8 plugin that is installed.
Other things are done by ruff.
It is faster, it has autofixing, there are lots of rules.
Basically, this way WPS just gain lots
of new rule and plugins almost for free.
It is now stricter than ever! WPS now officially supports
ALL ruff existing rules. This means that there are no conflicts
between two linters.
To run WPS and ruff together, use:
ruff format && ruff check && flake8 --select=WPS .You can copy our configuration from pyproject.toml (for ruff) and setup.cfg (for flake8).
Black
WPS can now also be used with black with default configuration.
However, we recommend using ruff format instead.
Speed
WPS got a lot faster! Because:
- We removed a lot of
flake8plugins - We removed a lot of rules covered by
ruff
Running 0.19.2 (previous version) on https://github.com/dry-python/returns
» time flake8 .
flake8 . 20.63s user 2.47s system 469% cpu 4.919 totalThe same on 1.0.0:
» time flake8 .
flake8 . 8.56s user 0.54s system 898% cpu 1.013 total
Which is 2.4x times faster!
Integrations
We also significantly improved all the integrations!
WPS can now be used as first-class pre-commit hook with:
repos:
- repo: https://github.com/wemake-services/wemake-python-styleguide
rev: 1.0.0
hooks:
- id: wemake-python-styleguideOur GitHub Action also got a lot of new options and fixes.
Removals
- Breaking: Drops
python3.9support - Breaking: Drops
nitpicksupport - Breaking: Drops
flake8-commas,flake8-isort,
flake8-debugger,flake8-string-format,flake8-quotes,
flake8-comprehensions,flake8-bugbear,flake8-docstrings,
flake8-eradicate,flake8-bandit,flake8-broken-line,
flake8-rst-docstrings,pep8-naming
support, useruff formatandruff checkinstead - Breaking: Drops
darglintsupport, because it is unmaintained - Breaking: Removes
WPS113, because is covered bypylintlinter - Breaking: Removes
WPS119, because is covered bypylintlinter - Breaking: Removes
WPS125, because it is covered byrufflinter - Breaking: Removes
WPS302, because it is covered byruffformatter - Breaking: Removes
WPS304, because it is covered byruffformatter - Breaking: Removes
WPS305, because it is covered byruffformatter - Breaking: Removes
WPS306, because it is covered byruffformatter - Breaking: Removes
WPS309, because it is covered byruffformatter - Breaking: Removes
WPS310, because it is covered byruffformatter - Breaking: Removes
WPS313, because it is covered byruffformatter - Breaking: Removes
WPS315, because it is covered byruffformatter - Breaking: Removes
WPS316, because it is covered byrufflinter - Breaking: Removes
WPS317, because it is covered byruffformatter - Breaking: Removes
WPS318, because it is covered byruffformatter - Breaking: Removes
WPS319, because it is covered byruffformatter - Breaking: Removes
WPS320, because it is covered byruffformatter - Breaking: Removes
WPS323, because it is covered byruffformatter - Breaking: Removes
WPS326, because it is covered byrufflinter - Breaking: Removes
WPS329, because it is covered byrufflinter - Breaking: Removes
WPS331, because it is covered byrufflinter - Breaking: Removes
WPS333, because is covered bypylintlinter - Breaking: Removes
WPS337, because it is covered byruffformatter - Breaking: Removes
WPS340, because it is covered byruffformatter - Breaking: Removes
WPS341, because it is covered byruffformatter - Breaking: Removes
WPS343, because it is covered byruffformatter - Breaking: Removes
WPS348, because it conflicts withruffformatter - Breaking: Removes
WPS351, because it is covered byrufflinter - Breaking: Removes
WPS352, because it is covered byruffformatter - Breaking: Removes
WPS355, because it is covered byruffformatter - Breaking: Removes
WPS360, because it is covered byruffformatter - Breaking: Removes
WPS361, because it is covered byruffformatter - Breaking: Removes
WPS415, because is covered byrufflinter - Breaking: Removes
WPS417, because is covered byrufflinter - Breaking: Removes
WPS419, because is covered byrufflinter - Breaking: Removes
WPS423, because is covered byrufflinter - Breaking: Removes
WPS424, because is covered byrufflinter - Breaking: Removes
WPS425, because is covered byrufflinter - Breaking: Removes
WPS428, because is covered byrufflinter - Breaking: Removes
WPS433, because is covered bypylintlinter - Breaking: Removes
WPS434, because is covered bypylintlinter - Breaking: Removes
WPS436, because is covered bypylintlinter - Breaking: Removes
WPS437, because is covered byrufflinter - Breaking: Removes
WPS440, because
it was buggy and is covered bymypy, #3209 - Breaking: Removes
WPS442, because
it was buggy and is covered bymypy, #3209 - Breaking: Removes
WPS450, because is covered bypylintlinter - Breaking: Removes
WPS452, because is covered byrufflinter - Breaking: Removes
WPS454, because is covered byrufflinter - Breaking: Removes
WPS456, because is covered byrufflinter - Breaking: Removes
WPS465, because|is now heavily used by typing - Breaking: Removes
WPS467, because is covered bypylintlinter - Breaking: Removes
WPS502, because is covered byrufflinter - Breaking: Removes
WPS503, because is covered byrufflinter - Breaking: Removes
WPS507, because is covered bypylintlinter - Breaking: Removes
WPS508, because is covered byrufflinter - Breaking: Removes
WPS510, because is covered bypylintlinter - Breaking: Removes
WPS514, because is covered bypylintlinter - Breaking: Removes
WPS528, because is covered bypylintlinter - Breaking: Removes
WPS525, because is covered byrufflinter - Breaking: Removes
WPS526, because is covered byrufflinter - Breaking: Removes
WPS521, because is covered byrufflinter - Breaking: Removes
WPS609, because is covered bypylintlinter - Breaking: Removes
--i-control-codesetting,
if you want to disable some violations, just use# noqaor--ignore
with code that you want to exclude, there's no need
to create one more way of disabling some specific violations
Features
- Adds official
python3.13support - Allows any compares in
assertstatements forWPS520, #3112 - Allows walrus operator (
:=) in comprehesions, #3121 - Allows
passincasebodies, #2642 - Allows subclassing builtins in
WPS600, when creating anEnum, #2506 - Allows using variables after blocks for
WPS441inassertstatements, #2543 - Does not count
self,cls, andmcsas arguments
forWPS211complexity check anymore, #2394 - Allows underscores (
_) with exactly 3 digits after it inWPS303, #3120 - Allows class / instance attribute shadowing
in@dataclasses forWPS601, #1926 - Allows any number of instance attributes on
@dataclasses inWPS230, #2448 - Allows any number of function parameters
in@overloaddefinitions forWPS211, #1957 - Allows using multiline strings when placed on separate lines, #3056
- Allows using
hasattrbuiltin function, #2228 - Disallows using
is notandnot inas negated conditions inWPS504, #2617 - Allows all branches in
if/elif/elseto be negated inWPS504, #2617 - Adds a new rule to forbid
lambdaassigns to special attributes, #1733 - Adds a new rule to check problematic function params, #1343
- Adds a new rule to detect duplicate conditions in
ifs andelifs, #2241 - Adds a new rule to detect duplicate
casepattens inmatch, #3206 - Adds a new rule to find too many
matchsubjects, #3201 - Adds a new rule to detect too many
casestatements, #3202 - Adds a new rule to find too complex
exceptwith too many exceptions - Adds a new rule to find too many
PEP695type params - Adds a new rule to find useless ternary expressions, #1706
- Adds a new rule to forbid
raise SystemExit, usesys.exitinstead, #1786 - Adds a new rule to forbid extra syntax in
match ...subjects, #3217 - Adds new
--allowed-module-metadataand--forbidden-module-metadata
configuration options forWPS410, #3060 - Now
--allowed-domain-namesalso affectWPS11
to allow custom short variable names, #2554 - Adds support to run
wemake-python-styleguideas apre-commithook, #2588 - GitHub Action can now use
cwd:parameter to specify
where your configuration file is, #2474 - GitHub Action can now use
fail_workflow:parameter to not fail
the workflow even if the check did find any issues - GitHub Action can now use
filter_mode:parameter to specify
how ReviewDog will filter found violations,
see https://github.com/reviewdog/reviewdog#filter-mode #2239
Bugfixes
- Fixes
WPS217to allow simple calls infstrings, #3150 - Fixes
WPS217not to raise on emptyfstrings,
becauseruff checkhandles that now for us - Fi...
Version 0.19.2
Bugfixes
- Fixes
WrongEmptyLinesCountViolationcrash 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
TooDeepNestingViolationnot to trigger
on...in functions and classes - Fixes
StatementHasNoEffectViolationnot to trigger
on...in functions and classes, when it is the only node
