Files
go-trustlog/.pre-commit-config.yaml

40 lines
1.3 KiB
YAML
Raw Normal View History

default_stages: [commit, push]
fail_fast: true # stop running hooks at the first failure
minimum_pre_commit_version: 4.2.0
exclude: |
(?x)(
cookiecutter-config-file.yml|
.cruft.json
)
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
# Verify syntax
- id: check-yaml
- id: check-json
- id: check-xml
# Checkers
- id: check-merge-conflict # check for merge conflict string
- id: detect-private-key # check for existence of private keys
# Implicit minor corrections to files
- id: end-of-file-fixer # ensure all files end with a new line
- id: trailing-whitespace # trim trailing whitespaces
# Good practices for executables/scripts
- id: check-executables-have-shebangs # non-binary executables have shebang
- id: check-shebang-scripts-are-executable # verify shebang scripts are executable
# Pretty format JSON files implicitly
- id: pretty-format-json
args: ["--autofix"]
# Debatable -- for most projects adding files larger than 10 MB is likely to be
# a mistake instead of a requirement. Remove this if needed
- id: check-added-large-files # fails if a file larger than 10 MB exists
args: ["--maxkb=10240", "--enforce-all"]