Wemake

Latest version: v0.1.0

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

Scan your dependencies

Page 2 of 8

0.12.5

Bugfixes

- We now ignore `overload` from `BlockAndLocalOverlapViolation`
- Now expressions that reuse block variables are not treated as violations,
example: `my_var = do_some(my_var)`

Misc

- Adds Github Action and docs how to use it
- Adds local Github Action that uses itself for testing
- Adds official Docker image and docs about it

0.12.4

Bugfixes

- Fixes bug with `nitpick` colors and new files API
- Updates `flake8-docstrings`

0.12.3

Bugfixes

- Fixes that formatting was failing sometimes when colours were not available
- Fixes that `1 / number` was not allowed
- Fixes that `%` operator was allowed for `0` and `1`

0.12.2

Features

- Adds `reveal_type` to the list of forbidden functions
- `WPS517` now allows to use non-string keys inside `**{}`,
so this is allowed: `Users.objects.get(**{User.USERNAME_FIELD: username})`

Bugfixes

- Fixes that `{**a, **b}` was reported as duplicate hash items

0.12.1

Features

- Tweaks `nitpick` configuration

Bugfixes

- Changes `radon` and `pydocstyle` versions for better resolution
- Fixes `nitpick` urls

Misc

- Improves `README.md` with `flakehell` and `nitpick` mentions
- Improves docs all accross the project

0.12.0

In this release we had a little focus on:

0. Primitives and constants and how to use them
1. Strings and numbers and how to write them
1. OOP features
1. Blocks and code structure,
including variable scoping and overlaping variables
1. Overused expressions and new complexity metrics

Features

- **Breaking**: moves `ImplicitInConditionViolation` from `WPS336` to `WPS514`
- **Breaking**: now `ExplicitStringConcatViolation` uses `WPS336`
- **Breaking**: moves `YieldMagicMethodViolation` from `WPS435` to `WPS611`
- Adds `xenon` as a dependency, it also checks for cyclomatic complexity,
but uses more advanced algorithm with better results
- Forbids to have modules with too many imported names
configured by `--max-imported-names` option which is 50 by default
- Forbids to raise `StopIteration` inside generators
- Forbids to have incorrect method order inside classes
- Forbids to make some magic methods async
- Forbids to use meaningless zeros in float, binary, octal, hex,
and expanentional numbers
- Enforces to use `1e10` instead of `1e+10`
- Enforces to use big letters for hex numbers: `0xAB` instead of `0xab`
- Enforces to use `r'\n'` instead of `'\\n'`
- Forbids to have unicode escape characters inside binary strings
- Forbids to use `else if` instead of `elif`
- Forbids to have too long `try` bodies,
basically `try` bodies with more than one statement
- Forbids to overlap local and block variables
- Forbids to use block variables after the block definitions
- Changes how `WrongSlotsViolation` works, now `(...) + value` is restricted
in favor of `(..., *value)`
- Forbids to have explicit unhashable types in sets and dicts
- Forbids to define useless overwritten methods
- Enforces `j` prefix over `J` for `complex` numbers
- Forbids overused expressions
- Forbids explicit `0` division, multiply, pow, addition, and substraction
- Fordids to pow, multiply, or divide by `1`
- Forbids to use expressions like `x + -2`, or `y - -1`, or `z -= -1`
- Forbids to multiply lists like `[0] * 2`
- Forbids to use variable names like `__` and `_____`
- Forbids to define unused variables explicitly: `_unused = 2`
- Forbids to shadow outer scope variables with local ones
- Forbids to have too many `assert` statements in a function
- Forbids to have explicit string contact: `'a' + some_data`, use `.format()`
- Now `YieldInsideInitViolation` is named `YieldMagicMethodViolation`
and it also checks different magic methods in a class
- Forbids to use `assert False` and other false-constants
- Forbids to use `while False:` and other false-constants
- Forbids to use `open()` outside of `with`
- Forbids to use `type()` for compares
- Forbids to have consecutive expressions with too deep access level
- Forbids to have too many public instance attributes
- Forbids to use pointless star operations: `print(*[])`
- Forbids to use `range(len(some))`, use `enumerate(some)` instead
- Forbids to use implicit `sum()` calls and replace them with loops
- Forbids to compare with the falsy constants like `if some == []:`

Bugfixes

- Bumps `flake8-eradicate` version
and solves `attrs` incompatible versions issue
- Bumps `flake8-dosctrings` veresion
and solved `pydocstyle` issue
- Fixes `TryExceptMultipleReturnPathViolation` not tracking `else` and `finally`
returns at the same time
- Fixes how `TryExceptMultipleReturnPathViolation` works:
now handles `break` and `raise` statements as well
- Fixes `WrongLoopIterTypeViolation` not triggering
for generator expressions and empty tuples
- Fixes `WrongLoopIterTypeViolation` not triggering
for numbers (including negative), booleans, `None`
- Fixes `WrongLoopIterTypeViolation` position
- Fixes `WrongLoopIterTypeViolation` not triggering for compehensions
- Fixes `WrongSlotsViolation` not triggering
for comprehensions and incorrect `__slots__` names and types
- Fixes `WrongSlotsViolation` not triggering
for invalid `python` identifiers like `__slots__ = ('123_slot',)`
- Fixes `WrongSlotsViolation` triggering for subscripts
- Fixes `NestedClassViolation` and `NestedFunctionViolation` not reporting
when placed deeply inside other nodes
- Fixes when `WrongUnpackingViolation` was not raised
for `async for` and `async with` nodes
- Fixes when `WrongUnpackingViolation` was not raised for comprehensions
- Fixes that `x, y, z = x, z, y` was not recognized
as `ReassigningVariableToItselfViolation`
- Fixes that `{1, True, 1.0}` was not recognised as a set with duplicates
- Fixes that `{(1, 2), (1, 2)}` was not recognised as a set with duplicates
- Fixes that `{*(1, 2), *(1, 2)}` was not recognised as a set with duplicates
- Fixes that `{1: 1, True: 1}` was not recognised as a dict with duplicates
- Fixes that `complex` numbers were always treated like magic,
now `1j` is allowed
- Fixes that `0.0` was treated as a magic number
- Fixes that it was possible to use `_` in module body
- Fixes `WrongBaseClassViolation` not triggering
for nested nodes like `class Test(call().length):`
- Fixes `ComplexDefaultValueViolation` not triggering
for nested nodes like `def func(arg=call().attr)`
- Fixes `TooShortNameViolation` was not triggering for `_x` and `x_`
- Fixes that some magic method were allowed to be generators
- Fixes that some magic method were allowed to contain `yield from`
- Fixes bug when some correct `noqa:` comments were reported as incorrect
- Fixes bug when some `else: return` were not reported as incorrect
- Fixes bug when `WPS507` sometimes were raising `ValueError`
- Fixes bug when `return None` was not recognized as inconsistent

Misc

- Adds `styles/` directory with style presets for tools we use and recommend
- Adds `bellybutton` to the list of other linters
- Documents how to use `nitpick` to sync the configuration
- Documents how to use `flakehell` to create `baseline`s for legacy integrations
- Improves tests for binary, octal, hex, and expanetional numbers
- Adds new `xenon` CI check
- Now handles exceptions in our own code, hope to never see them!
- Now uses `coverage` checks in deepsource
- Now `alias` checks that all aliases are valid
- Changes how presets are defined
- Improves how `DirectMagicAttributeAccessViolation` is tested
- Refactors a lot of tests to tests `ast.Starred`
- Refactors a lot of tests to have less tests with the same logical coverage
- We now use `import-linter` instead of `layer-linter`
- Adds docs about CI integration
- Now wheels are not universal
- Updates docs about `snake_case` in `Enum` fields
- Updates docs about `WPS400` and incorrect line number

Page 2 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.