hacking
OpenStack Hacking Guideline Enforcement
What it is and what it does
Hacking is a collection of flake8 plugins designed to automate enforcement of the OpenStack Style Guide. It extends flake8 with OpenStack-specific checks that catch style violations, dangerous patterns (like shadowing built-ins), and common programming errors. The tool runs as part of code review workflows to reduce manual style nitpicking and ensure consistency across projects with multiple authors.
The package pins its dependencies—flake8, pep8, mccabe, and pyflakes—to specific versions to prevent new releases of those tools from introducing stricter rules or new checks that would unexpectedly break existing code. This stability is important for projects that gate on hacking versions. Some checks are disabled by default and can be enabled via configuration. Hacking also supports local project-specific checks registered as plugins in tox.ini.
Use it for:
- Enforce OpenStack style guidelines in OpenStack projects and related codebases during CI/CD gating.
- Catch dangerous patterns like reserved-word shadowing and unsafe logging practices automatically before code review.
- Add project-specific linting rules by registering local plugins alongside hacking's built-in checks.
- Ensure code style consistency across teams by automating what would otherwise require manual reviewer effort.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Hacking is a set of flake8 plugins that enforce the OpenStack Style Guide through automated code checks, catching style violations and dangerous patterns without manual review.
Yes, if you are working on OpenStack projects or adopting the OpenStack Style Guide. The low install friction, active maintenance, and permissive license make it a straightforward addition to a flake8-based workflow. If your project does not follow OpenStack conventions, the checks may not be relevant; evaluate whether the built-in rules align with your style guide first.
Install
hacking on PyPI
pip
pip install hackinguv
uv add hackingpoetry
poetry add hackingInstalling hacking
Before you install
Low install friction with a single runtime dependency on flake8. Actively maintained with a recent release; pins its dependencies to prevent breaking changes from new versions of flake8 or its plugins.
License in practice
Apache-2.0 licensed under a permissive license, allowing use in proprietary and open-source projects without significant restrictions.
Quickstart
pip install hacking
Then in your project's tox.ini or .flake8 config:
[flake8]
enable-extensions = H106,H203
Run: flake8 your_code.py
Requires Python 3.10 or later. Hacking pins specific versions of flake8 and related plugins, so it will install those exact versions alongside itself.
Verify before relying
- Whether the pinned flake8 and plugin versions in a given hacking release are compatible with other linting tools in your workflow.
- How many OpenStack-specific checks are included in version 8.1.0 and whether they apply to non-OpenStack projects.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — flake8 |
| Maintenance | actively maintained — 64 days since the last release |
| First released | |
| Downloads | 197,427/month — #9,760 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hacking-8.1.0-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
flake8-mock-specA flake8 plugin that enforces the use of the…
permissive · top 15,000 on PyPI
wemake-python-styleguideA flake8 plugin that enforces strict,…
permissive · top 15,000 on PyPI
flake8Flake8 is a command-line tool that combines…
permissive · top 1,000 on PyPI
flake8-copyrightA flake8 plugin that enforces the presence of…
unclear · top 15,000 on PyPI
flake8-literalA flake8 plugin that enforces consistent…
copyleft · top 15,000 on PyPI
flake8-pyiA Flake8 plugin that lints Python type stub…
permissive · top 5,000 on PyPI
pytest-flake8A pytest plugin that runs flake8 PEP8…
permissive · top 15,000 on PyPI
flake8-type-checkingA flake8 plugin that identifies which imports…
permissive · top 15,000 on PyPI
flake8-deprecatedA flake8 plugin that detects calls to…
copyleft · top 15,000 on PyPI
pep8Checks Python code against PEP 8 style…
permissive · top 5,000 on PyPI