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

Watchers

Forks

Contributors