Pre-commit Hook¶
eigenhelm provides a pre-commit hook that evaluates staged files before each commit.
Setup¶
Add to your .pre-commit-config.yaml:
Then install:
What it does¶
On each commit, eigenhelm-check evaluates all staged Python files against the configured model and thresholds. If any file scores above the reject threshold, the commit is blocked.
Configuration¶
The hook reads from .eigenhelm.toml in your project root. The most relevant settings:
To make the hook stricter or more lenient, adjust these thresholds.
Skipping the hook¶
For exceptional cases:
Caching¶
The hook caches results by file content hash. Re-committing an unchanged file skips re-evaluation, making subsequent commits fast.