wemake-python-styleguide: Forbid incorrect assign pattern
Rule request
Thesis
We need to enforce:
a += b
instead of:
a = a + b
The same applies for all other operators: -, &, **, etc
https://rust-lang.github.io/rust-clippy/master/index.html#assign_op_pattern
Reasoning
The first version is correct and short. This is a consistency rule.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (16 by maintainers)
Commits related to this issue
- `WPS350` enforce using augmented assign pattern (#918) * Add ability customize nested classes whitelist (#808) * Add ability customize nested classes whitelist (#808) * Update CHANGELOG.md *... — committed to wemake-services/wemake-python-styleguide by deleted user 5 years ago
- `WPS525` forbids comparisons where `in` is compared with single item container (#932) * Add ability customize nested classes whitelist (#808) * Add ability customize nested classes whitelist (#808... — committed to wemake-services/wemake-python-styleguide by deleted user 5 years ago
Thanks a lot, @slapshin!
@slapshin see https://github.com/wemake-services/wemake-python-styleguide/pull/852
Ok. We will not handle commutative cases in this rule