Wemake-python-styleguide

Latest version: v1.0.0

Safety actively analyzes 701809 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 10

0.16.1

Bugfixes

- Fixes crash on `'Literal["raise"]'` annotation 2341
- Fixes `WPS471` was not detected on complex assignment targets 2301
- Fixes `flake8-bandit` and `bandit` version conflict 2368

0.16.0

Features

- Supports new `flake8` version `4.x`
- Now `InconsistentYieldViolation` and `InconsistentReturnViolation` are raised
when `yield` or `return` is used with `None`
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
misaligned `in` expressions 2075
- Fixes some common magic methods not being recognized as such 2281

Misc

- Removes all `Raises:` from docstrings, they were unused
- Added example to `README.md`
- Added `why strict is good`
- Replaced all `python` with `Python` in `README.md`
- Improve Docs: Fixed all typos and grammatical errors in `CHANGELOG.md`
- Updated documentation with the recommended `isort` config. 1934
- Updates `typing_extensions` to `4.x`

0.15.3

Bugfixes

- Fixes crash on `python3.10`
- Fixes `UselessReturningElseViolation` to not report `else` with `break` 1958
- Fixes `ReassigningVariableToItselfViolation` to not report on `x = (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 outside `for` loops 1883
- Fixes `UselessReturningElseViolation` to not report `else` with `break` 2187
(even if we have `except` in loop)
- Fixes fixture in `UselessReturningElseViolation` 2191

Misc

- Adds documentation (and tests) for how to run project on Jupyter Notebooks
- Updates `mypy` to `0.902` and fixes type issues

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 a `BoolOp`
- 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`

Features

- Adds a math operations evaluator to improve and allow several violation checks.

0.15.1

Bugfixes

- Fixes `dataclasses` import, it was failing on `python3.6`
- Fixes `InconsistentComprehensionViolation` work with `async` comprehensions
- Fixes nested comprehensions support for `InconsistentComprehensionViolation`
- Fixes multiple `if` support for `InconsistentComprehensionViolation`
- Fixes that `NestedTernaryViolation` was not reported for a comprehension
- Fixes that `ConstantConditionViolation` was not reported for a comprehension
- Fixes that `ConstantConditionViolation` was triggering for `while x := True:`
- Fixes that `UselessElseViolation` was not reported
for `for`, `while`, and `try` keywords
- Fixes false positive `InfiniteWhileLoopViolation` for `try` 1857
- Fixes that `InfiniteWhileLoopViolation` was not triggered on `1`
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 syntactically valid.

0.15.0

Features

- Adds `python3.9` support
- Forbids to use new-style decorators on `python3.9`
- Changes how we treat own/foreign attributes,
since now we only check assigned attribute names for `self`/`cls`/`mcs`,
but not any other ones.
So, now writing `point.x = 1` will not trigger any violations.
Previously, it would raise "too short name".
- Forbids using non-trivial expressions as an argument to `except`
- Forbids using too many variables in a tuple unpacking
- Forbids using `float("NaN")`.
- Forbids assigning to a slice
- Allow `__call__` method to be asynchronous
- Allows common strings not to be counted against string constant overuse limit
- Forbids to unpack iterable objects to lists 1259
- Forbids to use single `return None`
- Add `__await__` to the list of priority magic methods
- Forbids to use float zeros (`0.0`)
- Forbids `raise Exception` and `raise BaseException`
- Forbids to use `%` with zero as the divisor
- Forbids testing conditions to just return booleans
when it is possible to simply return the condition itself
- Forbids to use unsafe infinite loops
- Forbids to use raw strings `r''` when not necessary
- Forbids to use too complex `f`-strings
- Forbids to use too many `raise` statements inside a single function
- Forbids to compare with `float` and `complex` values
- Forbids single element destruct
- Forbids to ignore some violations (configurable) on a line level
- Forbids single element unpacking
- Forbids to unpack lists with side-effects
- Forbids to use multiline strings except for assignments and docstrings
- Forbids not returning anything in functions and methods starting with `get_`
- Forbids to use empty comment
- Forbids using bitwise operation with boolean operation
- Forbids inconsistent structuring of multiline comprehensions
- Forbids to use unpythonic getters and setters such as `get_attribute` or `set_attribute`
- Now `credits`, `license`, and `copyright` builtins are free to shadow

Bugfixes

- Fixes fails of annotation complexity on `Literal[""]`
- Fixes how wrong variable names were checked case sensitive with `WPS110`
- Fixes false positives DirectMagicAttributeAccessViolation with `__mro__`, `__subclasses__` and `__version__`
- Make `WPS326` work when there is comment between string literals
- Allowed yield statements in call method
- Allow to use `^` with `1`
- Fixes false positives in WPS513 and WPS323
- Fixes false positive WPS426 if `lambda` in loop uses only its arguments
- Fixes false negative WPS421 with `pprint.pprint`
- Fixes WPS441 triggering when reusing variable names in multiple loops
- Fixes false positive ImplicitEnumerateViolation on range with step 1742
- Allows to use `_` to declare several unused variables,
like: `x, _, _ = coordinates()`
- Fixes variable reassignment in class context
- Fixes that `*'abc'` was not counted as pointless star expression
- Fixes that `-some` was counted as overused expression
- Fixes several bugs with attribute names

Misc

- Updates lots of dependencies
- Fixed documentation for TooManyPublicAttributesViolation
- Updated isort config
- Introduce helper script to check
for missing calls to `self.generic_visit(node)` in AST visitors
- Updates `poetry` version to `1.1`
- Updates `reviewdog` version to `0.11.0` and adds `action-depup`

Page 2 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.