awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
pre-commit avatar

pre-commit/pre-commit-hooks

0
View on GitHub↗
6,593 stars·792 forks·Python·MIT·12 views

Pre Commit Hooks

This project is a comprehensive collection of pre-commit hooks designed to automate code linting, style enforcement, and file validation before changes are committed to version control. It provides a suite of ready-to-use scripts that serve as quality guards, including static analysis hooks, configuration file validators, and tools for maintaining version control integrity.

The collection distinguishes itself by offering specialized guards for repository health and security. This includes detection of leaked credentials and private keys, prevention of large file commits, and enforcement of branch protection to ensure a pull-request workflow. It also handles filesystem-specific issues such as OS-incompatible filenames, case-insensitive name conflicts, and the validation of symbolic links.

Broadly, the project covers automated code formatting to normalize whitespace, line endings, and quote styles, as well as syntax validation for Python, JSON, YAML, TOML, and XML. It further provides static analysis utilities to detect debugger statements, merge conflict markers, and incorrect test naming conventions.

Features

  • Code Formatting and Linting - Provides an automated suite of scripts for enforcing code style and linting standards before version control submission.
  • Pre-commit Hooks - Provides a comprehensive collection of ready-to-use pre-commit hooks for automated linting and validation.
  • Code Formatting - Implements automated tools for enforcing consistent code formatting and style via pre-commit hooks.
  • Regex Pattern Matching - Uses regular expressions to identify prohibited patterns, sensitive secrets, or formatting inconsistencies in files.
  • Configuration File Validators - Provides automated verification of syntax and structure for project configuration files.
  • Coding Style Tools - Ships scripts for normalizing line endings, trimming whitespace, and formatting structured data files.
  • Syntax and Type Verification - Verifies that Python files parse as valid code to prevent syntax errors in the repository.
  • Git Repository Maintenance Tools - Ensures repository health by detecting OS-incompatible filenames, broken symlinks, and oversized files.
  • Shell Orchestrators - Orchestrates the execution of discrete script-based hooks and processes their exit codes to gate commits.
  • Text Transformations - Implements a pipeline of idempotent rules for normalizing file contents across the codebase.
  • Static Syntax Validation - Automatically checks various file formats for syntax errors to prevent broken code from entering version control.
  • Secret Detection Tools - Provides automated scanning to detect leaked private keys and cloud credentials before they are committed to version control.
  • Secret Leak Prevention - Scans source code for private keys and cloud credentials to prevent accidental exposure of secrets.
  • Syntax Validation - Provides AST-based syntax validation to ensure code is grammatically correct before commits.
  • Static Analysis - Implements automated checks to detect syntax errors, debugger statements, and secrets before commit.
  • Pre-Commit Quality Checks - Prevents large files, case conflicts, and broken symlinks from being committed via quality guards.
  • Automated Version Control Workflows - Enforces quality standards and repository structure by blocking direct commits to protected branches.
  • Line Ending Standards - Standardizes mixed line endings and ensures every file ends with exactly one newline character.
  • Quote Style Configurations - Normalizes string quote styles by replacing double quotes with single quotes for consistency.
  • JSON Formatting and Sorting - Pretty-prints JSON files with sorted keys and consistent indentation for improved readability.
  • TOML Syntax Validators - Provides automated syntax validation for TOML files to ensure structural correctness before commits.
  • XML Syntax Validators - Provides automated syntax validation for XML files to ensure structural correctness before commits.
  • CI Conflict Detection - Detects merge conflict markers in files to prevent unresolved conflicts from being committed.
  • YAML Key Sorting - Sorts top-level keys in YAML files while preserving comments and block structures.
  • YAML Syntax Validation - Provides automated syntax validation for YAML files to ensure structural correctness before commits.
  • Branch Protections - Blocks direct commits to specified branches to enforce a strict pull-request workflow.
  • Whitespace Cleaners - Automatically removes trailing whitespace from the ends of lines while preserving specific markup.
  • Commit Blockers - Implements commit blocking to prevent files exceeding a specified size threshold from entering the repository.
  • JSON Syntax Validators - Provides automated syntax validation for JSON files to ensure structural correctness before commits.
  • Filesystem Metadata Inspection - Inspects file permissions, symbolic links, and naming conventions to ensure cross-platform repository compatibility.
  • Debugger Statement Detection - Scans source code for debugger imports and breakpoint calls to prevent shipping debug code.

Star history

Star history chart for pre-commit/pre-commit-hooksStar history chart for pre-commit/pre-commit-hooks

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does pre-commit/pre-commit-hooks do?

This project is a comprehensive collection of pre-commit hooks designed to automate code linting, style enforcement, and file validation before changes are committed to version control. It provides a suite of ready-to-use scripts that serve as quality guards, including static analysis hooks, configuration file validators, and tools for maintaining version control integrity.

What are the main features of pre-commit/pre-commit-hooks?

The main features of pre-commit/pre-commit-hooks are: Code Formatting and Linting, Pre-commit Hooks, Code Formatting, Regex Pattern Matching, Configuration File Validators, Coding Style Tools, Syntax and Type Verification, Git Repository Maintenance Tools.

What are some open-source alternatives to pre-commit/pre-commit-hooks?

Open-source alternatives to pre-commit/pre-commit-hooks include: sds/overcommit — Overcommit is a Git hook manager and pre-commit validation framework designed to automate the execution of scripts and… diffplug/spotless — Spotless is a multi-language formatting orchestrator and Gradle plugin that automates code styling across various… google/gts — gts provides standardized utilities for project bootstrapping and the application of consistent linting and formatting… astral-sh/ruff — Ruff is a high-performance static analysis and code formatting tool designed for Python. Built in Rust, it functions… j178/prek — Prek is a Git hook manager written in Rust that runs configured hooks as a single binary without requiring Python or… prettier/prettier — Prettier is an opinionated code formatter that parses source code and reprints it from scratch to enforce a…

Open-source alternatives to Pre Commit Hooks

Similar open-source projects, ranked by how many features they share with Pre Commit Hooks.
  • sds/overcommitsds avatar

    sds/overcommit

    4,008View on GitHub↗

    Overcommit is a Git hook manager and pre-commit validation framework designed to automate the execution of scripts and checks during various Git events. It serves as a workflow automation tool that ensures code quality and project standards are met before changes are committed or pushed to a remote repository. The system distinguishes itself through a comprehensive YAML-based configuration that allows for detailed hook behavior control, including file execution filtering, conditional skipping, and the management of hook dependencies. It provides specialized roles such as a commit message vali

    Ruby
    View on GitHub↗4,008
  • diffplug/spotlessdiffplug avatar

    diffplug/spotless

    5,527View on GitHub↗

    Spotless is a multi-language formatting orchestrator and Gradle plugin that automates code styling across various programming languages within a single build pipeline. It functions as a coordinator for multiple third-party formatters, a code style linting tool, and a system for inserting and updating standardized license headers. The project distinguishes itself through git-integrated style enforcement, using pre-push hooks and git references to apply formatting only to modified files or lines. It supports shared build configurations, allowing formatting rules to be distributed and loaded acr

    Java
    View on GitHub↗5,527
  • google/gtsgoogle avatar

    google/gts

    5,284View on GitHub↗

    gts provides standardized utilities for project bootstrapping and the application of consistent linting and formatting style guides. It functions as a TypeScript project bootstrapper that initializes new projects with standardized dependencies, build scripts, and compiler settings. The project implements a comprehensive TypeScript style guide consisting of a predefined collection of rules for static analysis and a code formatter that automatically adjusts source code spacing and syntax. These tools identify and fix code style violations to ensure uniformity across codebases. Additional capab

    TypeScriptformattergooglelinter
    View on GitHub↗5,284
  • astral-sh/ruffastral-sh avatar

    astral-sh/ruff

    48,177View on GitHub↗

    Ruff is a high-performance static analysis and code formatting tool designed for Python. Built in Rust, it functions as a comprehensive engine that scans source code to detect programming errors, security vulnerabilities, and deviations from established coding standards. By parsing source code into a structured tree representation, it provides both automated linting and style enforcement across entire projects. The tool distinguishes itself through its speed and deep integration into the development lifecycle. It utilizes parallelized file processing to maximize throughput on large codebases

    Rustlinterpep8python
    View on GitHub↗48,177
  • See all 30 alternatives to Pre Commit Hooks→

    Curated searches featuring Pre Commit Hooks

    Hand-picked collections where Pre Commit Hooks appears.
    • Automated Code Linting and Formatting
    • Secret and API Key Scanners