A framework for managing and maintaining multi-language pre-commit hooks.
open sourceMITself-hostablefree
pre-commit manages git hooks declared in .pre-commit-config.yaml, installing each hook's tool in an isolated environment (Python, Node, Ruby, Go, Rust, Docker and more) and running it on staged files. A large ecosystem of ready-made hooks covers linters and formatters, and pre-commit.ci runs the same hooks on pull requests.
Ways to install
Package managers
Problems it solves
- people keep pushing code that fails the linter
- run formatters automatically before every commit
- share the same git hooks with the whole team via a config file in the repo
- git hooks in .git/hooks are not versioned and nobody installs them
- run linters written in different languages without installing each one globally
- only lint the files that are staged for commit
- catch secrets or large files before they are committed
- run the same checks in CI that run locally on commit
Features
- .pre-commit-config.yaml
- isolated hook environments
- multi-language hooks
- hook repositories
- runs on staged files
- pre-commit.ci
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what pre-commit does.