{"id":5932,"library":"flake8-variables-names","title":"Flake8 Variables Names","description":"Flake8 Variables Names is a Flake8 extension designed to promote more readable variable names in Python code. It identifies single-character variable names or overly common and ambiguous names such as 'result', 'value', or 'info', flagging them for clarification. The current version is 0.0.6, with releases occurring periodically to introduce new features and fix bugs.","status":"active","version":"0.0.6","language":"en","source_language":"en","source_url":"https://github.com/best-doctor/flake8-variables-names","tags":["flake8","linter","code-quality","naming-conventions","variables"],"install":[{"cmd":"pip install flake8-variables-names","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"This is a plugin for Flake8 and requires Flake8 to be installed to function.","package":"flake8","optional":false}],"imports":[{"note":"Flake8 plugins are activated through Flake8's configuration or command-line execution, not via direct imports in application code.","symbol":"VariableNamesChecker","correct":"This is a Flake8 plugin and typically doesn't require direct imports in user code for its core functionality. It is automatically loaded by Flake8 upon installation. For programmatic access to its version, you might import from `flake8_variables_names`."}],"quickstart":{"code":"# 1. Install the library\n# pip install flake8 flake8-variables-names\n\n# 2. Create a Python file, e.g., my_module.py\n# def process_data(d):\n#     i = 0\n#     res = d * 2\n#     info = 'processed'\n#     return res, info\n\n# 3. Run flake8 on your file or project\n# flake8 my_module.py\n\n# Example of flake8 output:\n# my_module.py:2:13: VNE001 single letter variable names like 'd' are not allowed\n# my_module.py:3:5: VNE001 single letter variable names like 'i' are not allowed\n# my_module.py:4:5: VNE002 variable name 'res' should be clarified\n# my_module.py:5:5: VNE002 variable name 'info' should be clarified\n\n# 4. To enable strict mode (more aggressive checks):\n# flake8 --use-varnames-strict-mode my_module.py\n# Or in a config file (setup.cfg, tox.ini, or .flake8):\n# [flake8]\n# use-varnames-strict-mode = True","lang":"bash","description":"After installation, `flake8-variables-names` automatically integrates with `flake8`. Run `flake8` from your terminal to apply checks. Configuration, including enabling strict mode, can be done via command-line arguments or in a `flake8` configuration file (e.g., `setup.cfg`, `tox.ini`, or `.flake8`)."},"warnings":[{"fix":"Review existing code with multiple assignments (`a, b = 1, 2`) after updating to `0.0.6` to ensure compliance with the updated variable naming rules. Adjust variable names as required by the linter's output.","message":"In version `0.0.6`, a bug fix changed the behavior for multiple assignments. Expressions like `a, b = 1, 2` are now correctly marked as invalid if `a` or `b` violate naming conventions.","severity":"breaking","affected_versions":">=0.0.6"},{"fix":"To enable more comprehensive checks, activate strict mode. Use the `--use-varnames-strict-mode` command-line option or add `use-varnames-strict-mode = True` to your `[flake8]` configuration in `setup.cfg`, `tox.ini`, or `.flake8`.","message":"By default, `flake8-variables-names` operates in a 'non-strict' mode. This means some common but ambiguous variable names (e.g., 'data', 'result', 'value') are not flagged unless 'strict mode' is explicitly enabled.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Familiarize yourself with the error codes: VNE001 for single-letter variable names, VNE002 for ambiguous/unclarified names, and VNE003 for names shadowing builtins. Refer to the plugin's documentation or source code for a complete list and their meanings to effectively resolve reported issues.","message":"The plugin introduces specific error codes (VNE001, VNE002, VNE003) for various naming violations. Not understanding these codes can make it difficult to interpret `flake8`'s output.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z","problems":[]}