Skip to content

cleder/awesome-pre-commit-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Awesome Pre-commit Hooks

A curated collection of pre-commit and prek hooks, organized by language and framework.

Auto-generated by pc-init presets — to add or update a hook, open a PR there rather than editing this file directly.

Contents


Common

  • codespell — check code for common misspellings
  • detect-secrets — An enterprise friendly way of detecting and preventing secrets in code.
  • gitleaks — Find secrets with Gitleaks 🔑
  • jscpd — Copy/paste detector for programming source code, supports 223 formats. AI-ready with token-efficient reporter, skill and MCP server.
  • lychee — ⚡ Fast, async, stream-based link checker written in Rust. Finds broken URLs and mail addresses inside Markdown, HTML, reStructuredText, websites and more!
  • pre-commit-hooks — Some out-of-the-box hooks for pre-commit
  • pre-commit-sort — Sort .pre-commit-config.yaml & .pre-commit-hooks.yaml
  • semgrep — Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.
  • talisman — Using a pre-commit hook, Talisman validates the outgoing changeset for things that look suspicious — such as tokens, passwords, and private keys.
  • truffleHog — Find, verify, and analyze leaked credentials
  • typos — Source code spell checker
  • vale — 📝 A markup-aware linter for prose built with speed and extensibility in mind.
  • vercheck — Check if a version number is PEP-440 compliant and optionally compare it against a version specified in a python file or the pyproject/cargo.toml

Languages

🔩 C / C++ (cpp)

🎨 CSS / SCSS / Sass (css)

🐳 Docker (docker)

  • checkov — Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
  • hadolint — Dockerfile linter, validate inline bash, written in Haskell

🐹 Go (go)

  • pre-commit-golang — Pre-commit hooks for Golang with support for monorepos, the ability to pass arguments and environment variables to all hooks, and the ability to invoke custom go tools.

🖼️ Images (img)

  • oxipng — Multithreaded PNG optimizer written in Rust

🟨 JavaScript (js)

🟣 Kotlin (kt)

🛠️ Makefiles (make)

  • checkmake — Linter/analyzer for Makefiles

📝 Markdown (md)

  • doctoc — 📜 Generates table of contents for markdown files inside local git repository. Links are compatible with anchors generated by github or other sites.
  • markdownlint-cli2 — A fast, flexible, configuration-based command-line interface for linting Markdown/CommonMark files with the markdownlint library
  • proselint — A linter for prose.
  • rumdl-pre-commit — Pre-commit hook for rumdl, a rust-based Markdown linter.

📓 Jupyter Notebooks (nb)

  • nbQA — Run ruff, isort, pyupgrade, mypy, pylint, flake8, and more on Jupyter Notebooks
  • nbstripout — strip output from Jupyter and IPython notebooks

📦 Protocol Buffers (proto)

  • buf — The best way of working with Protocol Buffers.

🐍 Python (py)

📊 R (r)

  • precommit — pre-commit hooks for R projects

💎 Ruby (rb)

  • rubocop — A Ruby static code analyzer and formatter, based on the community Ruby style guide.

🦀 Rust (ru)

🐚 Shell / Bash (sh)

  • bashate — Code style enforcement for bash programs. Mirror of code maintained at opendev.org.
  • pre-commit-shfmt — shfmt hook for prek and pre-commit, with auto install
  • shellcheck-py — python3/pip3 wrapper for installing shellcheck

🗄️ SQL (sql)

  • sqlfluff — A modular SQL linter and auto-formatter with support for multiple dialects and templated code.

🐦 Swift (swift)

  • SwiftFormat — A command-line tool and Xcode Extension for formatting Swift code
  • SwiftLint — A tool to enforce Swift style and conventions.

🏗️ Terraform (tf)

  • checkov — Prevent cloud misconfigurations and find vulnerabilities during build-time in infrastructure as code, container images and open source packages with Checkov by Bridgecrew.
  • pre-commit-terraform — pre-commit git hooks to take care of Terraform configurations 🇺🇦

🔧 TOML (toml)

🔷 TypeScript (ts)

📄 YAML (yaml)

  • ryl-pre-commit — Pre-commit hook for ryl
  • yamlfmt — An extensible command line tool or library to format yaml files.

Frameworks

🤖 Ansible (ansible)

Recommended language(s): yaml.

  • ansible-lint — ansible-lint checks playbooks for practices and behavior that could potentially be improved and can fix some of the most common ones for you

🎸 Django (django)

Recommended language(s): py.

  • django-codemod — A tool to automatically fix Django deprecations.
  • django-upgrade — Automatically upgrade your Django projects.
  • django-urlconfchecks — A package for type-checking the URLs and associated views for Django
  • djLint — ✨ HTML Template Linter and Formatter. Django - Jinja - Nunjucks - Handlebars - GoLang
  • pre-commit-hooks-django — Some useful hooks for Django development
  • pytest-mrt — Catch database migration rollback failures before they reach production

🔀 Git Workflow (git)

  • actionlint:octocat: Static checker for GitHub Actions workflow files
  • check-jsonschema — A CLI and set of pre-commit hooks for jsonschema validation with built-in support for GitHub Workflows, Renovate, Azure Pipelines, and more!
  • commit-check — Commit Check enforces commit metadata standards — commit messages, branch naming, committer info, signoff, and more.
  • commitizen — Create committing rules for projects 🚀 auto bump versions ⬆️ and auto changelog generation 📂
  • gitlint — Linting for your git commit messages
  • zizmor-pre-commit — A pre-commit hook for zizmor.

☸️ Kubernetes (k8s)

Recommended language(s): docker, tf.

  • kube-linter — KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices.
  • kubeconform-helm — Tools to test Helm chats with "kubeconform".
  • pre-commit — A collection of pre-commit hooks used by Gruntwork tools

⚛️ React (react)

Recommended language(s): js, ts, css.

  • local

📚 Sphinx Documentation (sphinx)

  • rstcheck — Checks syntax of reStructuredText and code blocks nested within it
  • rstfmt — A formatter for reStructuredText
  • sphinx-lint — Check for stylistic and formal issues in .rst and .py files included in the documentation

About

A collection of awesome pre-commit/prek hooks

Topics

Resources

License

Stars

3 stars

Watchers

0 watching

Forks

Contributors