Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/best-doctor/flake8-variables-names
A flake8 extension that helps to make more readable variables names
https://github.com/best-doctor/flake8-variables-names
flake8 flake8-plugin naming-conventions
Last synced: 3 months ago
JSON representation
A flake8 extension that helps to make more readable variables names
- Host: GitHub
- URL: https://github.com/best-doctor/flake8-variables-names
- Owner: best-doctor
- License: mit
- Created: 2019-02-07T11:45:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T16:04:24.000Z (4 months ago)
- Last Synced: 2024-07-15T14:08:13.776Z (4 months ago)
- Topics: flake8, flake8-plugin, naming-conventions
- Language: Python
- Size: 39.1 KB
- Stars: 55
- Watchers: 1
- Forks: 14
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-flake8-extensions - flake8-variables-names - Extension that helps to make more readable variables names. (Naming)
README
# flake8-variables-names
[![Build Status](https://github.com/best-doctor/flake8-variables-names/actions/workflows/build.yml/badge.svg?branch=master)](https://github.com/best-doctor/flake8-variables-names/actions/workflows/build.yml)
[![Maintainability](https://api.codeclimate.com/v1/badges/c7502e578af3f4437179/maintainability)](https://codeclimate.com/github/best-doctor/flake8-variables-names/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/c7502e578af3f4437179/test_coverage)](https://codeclimate.com/github/best-doctor/flake8-variables-names/test_coverage)
[![PyPI version](https://badge.fury.io/py/flake8-variables-names.svg)](https://badge.fury.io/py/flake8-variables-names)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/flake8-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
```terminal
pip install flake8-variables-names
```## Example
Sample file:
```python
# test.pya = 1
foo = 2
result = a + foo
```Usage:
```terminal
$ 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 |## Contributing
We would love you to contribute to our project. It's simple:
- Create an issue with bug you found or proposal you have.
Wait for approve from maintainer.
- Create a pull request. Make sure all checks are green.
- Fix review comments if any.
- Be awesome.Here are useful tips:
- You can run all checks and tests with `make check`.
Please do it before CI does.
- We use [BestDoctor python styleguide](https://github.com/best-doctor/guides/blob/master/guides/en/python_styleguide.md).
- We respect [Django CoC](https://www.djangoproject.com/conduct/).
Make soft, not bullshit.