Hacking is an OpenStack project that provides a set of Flake8 plugins to enforce the OpenStack Hacking Guidelines for Python code. It helps developers maintain consistent code style and identify common pitfalls specific to the OpenStack development community. The current version is 8.0.0, and it follows a release cadence tied to OpenStack cycles, with updates typically occurring every few months or as new guideline enforcement is required.
pip install flake8 hackingNo compatibility data collected yet for this library.
This quickstart demonstrates how to install `flake8` and `hacking`, create a sample Python file with a common OpenStack hacking violation (H301), and then run `flake8` to see the generated warning. `hacking` automatically integrates its checks with `flake8` upon installation.
Upgrade your Python environment to 3.10+ or pin `hacking` to a compatible older version (e.g., `hacking<8.0.0`) if Python upgrade is not feasible.
Ensure `flake8>=6.0.0` is installed in your environment alongside `hacking`. Use `pip install --upgrade flake8`.
Instead of `import hacking`, run `flake8` from your command line in your project directory. `hacking` contributes checks that `flake8` then executes.
`hacking` is a `flake8` plugin, not a library for direct import. Ensure it's installed (`pip install hacking`) and then run `flake8` from your terminal.
Remove `--select Hxxx` arguments. `hacking` checks are automatically included. If you need to enable/disable specific checks, use a `.flake8` or `pyproject.toml` configuration file (e.g., `[flake8]\nignore = H301` to ignore).