A flake8 extension that helps to make more readable variables names
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install flake8-variables-namesflake8-variables-names
An extension for flake8 that helps to make more readable variables names.
We believe, that variable name should unmistakably shows, what it contains.
Thats why we try not to use varnames with only one symbol or not to use
too common names, such as result, value or info.
This extensions helps to detect such names. By default it works in
non-strict mode. You can change it with --use-varnames-strict-mode
parameter end extend variable names blacklist even more.
Installation
pip install flake8-variables-names
Example
Sample file:
# test.py
a = 1
foo = 2
result = a + foo
Usage:
$ flake8 test.py
test.py:1:1: VNE001 single letter variable names are not allowed
test.py:2:1: VNE002 variable name should be clarified
Error codes
| Error code | Description |
|---|---|
| VNE001 | single letter variable names like 'XXX' are not allowed |
| VNE002 | variable name 'XXX' should be clarified |
| VNE003 | variable names that shadow builtins are not allowed |