Python wrapper around invoking hadolint (https://github.com/hadolint/hadolint)
Actively maintained. Last release 5 weeks ago, commits in 12 of the last 26 weeks. A safe choice.
pip install hadolint-pyhadolint-pre-commit
A pre-commit hook for hadolint that automatically downloads and installs the hadolint binary — no manual installation required.
Background
The official hadolint/hadolint repository provides a pre-commit hook configuration, but it does not auto-install the hadolint binary. Users who add it to their .pre-commit-config.yaml are met with:
Executable `hadolint` not found
This is a known, long-standing issue that affects everyone who tries to use hadolint as a zero-dependency pre-commit hook. The official hook assumes you have already installed hadolint separately (e.g. via brew install hadolint), which defeats the purpose of a self-contained pre-commit integration.
This project solves that problem. It distributes the official, pre-built hadolint binary through PyPI as a platform-specific wheel. When pre-commit sets up the hook environment, it runs pip install hadolint-py automatically — and your binary is ready to use.
Usage
Add the following to your .pre-commit-config.yaml:
repos:
- repo: https://github.com/shenxianpeng/hadolint-pre-commit
rev: v2.15.1.3
hooks:
- id: hadolint