Skip to content

Instantly share code, notes, and snippets.

@ryanpeach
Created September 11, 2024 19:43
Show Gist options
  • Save ryanpeach/05b840f88c5d5339a53708f752ef2c2a to your computer and use it in GitHub Desktop.
Save ryanpeach/05b840f88c5d5339a53708f752ef2c2a to your computer and use it in GitHub Desktop.
My favorite pre-commits
exclude: "docs|.git"
default_stages: [commit]
fail_fast: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- id: check-json
- id: check-merge-conflict
- id: check-toml
- id: check-xml
- id: detect-private-key
- id: mixed-line-ending
args: ["--fix=lf"]
- id: no-commit-to-branch
args: [--branch, debug, --branch, master]
- id: pretty-format-json
args: ["--autofix"]
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.4.1
hooks:
- id: remove-tabs
- id: remove-crlf
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: shellcheck
- id: markdown-link-check
# Terraform
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.78.0
hooks:
- id: terraform_docs
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: terraform-fmt
- id: terraform-docs
- id: terraform-validate
- id: tflint
# K8s
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: helmlint
# Rust
- repo: https://github.com/doublify/pre-commit-rust
rev: v1.0
hooks:
- id: fmt
- id: cargo-check
- id: clippy
# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.6.4
hooks:
# Run the linter.
- id: ruff
types_or: [python, pyi]
args: [--fix]
# Run the formatter.
- id: ruff-format
types_or: [python, pyi]
- repo: https://github.com/RobertCraigie/pyright-python
rev: v1.1.379
hooks:
- id: pyright
# Golang
- repo: https://github.com/gruntwork-io/pre-commit
rev: v0.1.23
hooks:
- id: gofmt
- id: golint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment