# pre-commit/pre-commit

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/pre-commit-pre-commit).**

15,057 stars · 929 forks · Python · mit

## Links

- GitHub: https://github.com/pre-commit/pre-commit
- Homepage: https://pre-commit.com
- awesome-repositories: https://awesome-repositories.com/repository/pre-commit-pre-commit.md

## Topics

`git` `linter` `pre-commit` `python` `refactoring`

## Description

Pre-commit is a framework for managing and executing automated tasks during the version control commit process. It functions as a configuration-driven utility that enforces project standards by running linters, formatters, and security scanners on staged files before they are committed to a repository.

The system uses a centralized manifest to orchestrate these tasks, ensuring consistent developer tooling across teams. It distinguishes itself by provisioning isolated environments for each tool, which prevents dependency conflicts and ensures that all required versions are present. The framework also employs lazy dependency resolution to minimize setup time, fetching and installing necessary tools only when they are first required.

Beyond standard linting and formatting, the project supports the definition of custom, project-specific hooks to handle unique repository requirements. It provides granular control over execution through pattern-based file filtering, ensuring that validation tools only process relevant code changes. These configurations can be shared across multiple repositories to standardize development workflows and maintain uniform quality assurance standards.

## Tags

### Development Tools & Productivity

- [Git Hook Managers](https://awesome-repositories.com/f/development-tools-productivity/git-hook-managers.md) — Automates the installation and execution of Git hooks to enforce code quality standards before commits are finalized.
- [Development Workflow Automators](https://awesome-repositories.com/f/development-tools-productivity/development-workflow-automators.md) — Provides a configuration-driven framework for managing and executing automated tasks during the version control commit process.
- [Automated Version Control Workflows](https://awesome-repositories.com/f/development-tools-productivity/automated-version-control-workflows.md) — Enforces quality standards by triggering validation tools during version control events. ([source](https://pre-commit.com/))
- [Isolated Execution Environments](https://awesome-repositories.com/f/development-tools-productivity/development-environment-management/development-environments/isolated-execution-environments.md) — Provides sandboxed runtimes to ensure environment consistency for automated tasks. ([source](https://pre-commit.com/))
- [File Filtering Utilities](https://awesome-repositories.com/f/development-tools-productivity/file-filtering-utilities.md) — Applies regular expression matching to staged file paths to ensure tools only process relevant changes.

### Software Engineering & Architecture

- [Automated Code Quality Tools](https://awesome-repositories.com/f/software-engineering-architecture/automated-code-quality-tools.md) — Enforces project standards by running formatters and security scanners on staged files before they are committed. ([source](https://pre-commit.com/hooks.html))
- [Custom Hook Definitions](https://awesome-repositories.com/f/software-engineering-architecture/integration-extensibility/extensibility/plugin-architectures/hook-event-orchestration/custom-hook-definitions.md) — Provides mechanisms for defining custom hook instances with specific execution patterns. ([source](https://pre-commit.com/index.html))
- [Team Configuration Standards](https://awesome-repositories.com/f/software-engineering-architecture/project-management-governance/project-governance/standards-rule-enforcement/team-configuration-standards.md) — Enforces consistent formatting and style across multiple projects using shared configuration files.
- [Plugin-Based Architectures](https://awesome-repositories.com/f/software-engineering-architecture/software-architecture/architectural-patterns/plugin-module-systems/modular-plugin-architectures/plugin-based-architectures.md) — Allows extending core functionality by loading external or local scripts as modular units.
- [Declarative Configuration Managers](https://awesome-repositories.com/f/software-engineering-architecture/declarative-configuration-managers.md) — Uses a centralized manifest file to define execution order and filtering rules for automated tasks.

### DevOps & Infrastructure

- [Virtual Environment Managers](https://awesome-repositories.com/f/devops-infrastructure/dependency-management/environment-scoping-controls/virtual-environment-managers.md) — Creates isolated runtime environments for each tool to prevent dependency conflicts.
- [Project Configuration Managers](https://awesome-repositories.com/f/devops-infrastructure/configuration-management/configuration-resolution-engines/project-configuration-managers.md) — Centralizes the management of configuration settings for project-wide task execution. ([source](https://pre-commit.com/))
