pre-commit
A command-line framework for managing and running multi-language Git pre-commit hooks across projects.
These buttons open the developer's own site, repository or store listing in a new tab. wares.gg does not host downloads.
1 more ways to get pre-commit
Package managers
- Homebrew
brew install pre-commit
About pre-commit
pre-commit runs checks on every Git commit to catch simple issues such as trailing whitespace, missing semicolons and leftover debug statements before code review. You list the hooks you want in a configuration file and pre-commit installs and runs them.
It acts as a package manager for hooks, so a linter written in another language, such as a Ruby-based SCSS linter in a Node project, can be used without setting up that language yourself. It also supports CI use through a GitHub Action.
Strengths
- Installs hook environments for many languages automatically
- Hooks shared across projects through a single config file
- Works locally and in CI
Limitations
- Requires Python to run
- First run can be slow while hook environments are installed
Details
- Pricing
- FreeFree and open source.
- License
- MIT
- Developer
- The pre-commit contributors
- Platforms
- Windows, macOS, Linux, Command line
- How it runs
- Downloadable app
- Account
- Not required
- Best suited for
- Development teams that want consistent lint and format checks before each commit
- Categories
- Developer tools
- Last verified
- Added
- Provenance
- Facts checked against the developer's own pages and store listings, 1 sources on file.
Alternatives to pre-commit
Compare allSoftware that can replace pre-commit for an important use case, and what changes if you switch.
prek
Run code checks using existing pre-commit hooks and configurations.
prek runs the same pre-commit hooks and configurations, so existing setups carry over, though individual hooks may still need their own tools and dependencies installed.
Similar software
Related functionality, not necessarily a direct replacement.
Ruff
Lint and format Python code with one fast command-line tool.
ShellCheck
Catch common shell-script mistakes before running them.
detect-secrets
A command-line tool from Yelp that detects and prevents secrets such as keys being committed to code.
ESLint
A pluggable linter that finds and automatically fixes problems in JavaScript and JSX code.
Prettier
An opinionated code formatter for JavaScript, TypeScript, CSS, HTML, Markdown and other languages.
Hadolint
Dockerfile linter that also checks the shell commands inside it.