mirror of
https://github.com/daeuniverse/dae.git
synced 2024-12-22 20:24:40 +07:00
064bf1ebbc
* chore: add pre-commit-hook * doc(contribute): add pre-commit setup guide * doc(contribute.md): add pre-commit doc url * chore(pre-commit): add gofmt custom hook * fix: fix syntax * chore(pre-commit): rename gofmt as gofmt-fixer * chore(pre-commit): add config reference * chore(pre-commit): add golangci-lint
31 lines
781 B
YAML
31 lines
781 B
YAML
# reference: https://verdantfox.com/blog/view/how-to-use-git-pre-commit-hooks-the-hard-way-and-the-easy-way
|
|
---
|
|
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-json
|
|
- id: check-yaml
|
|
args:
|
|
- --unsafe
|
|
- id: double-quote-string-fixer
|
|
- id: end-of-file-fixer
|
|
- repo: https://github.com/golangci/golangci-lint
|
|
rev: v1.52.2
|
|
hooks:
|
|
- id: golangci-lint
|
|
- repo: local
|
|
hooks:
|
|
- id: gofmt-fixer
|
|
name: gofmt
|
|
entry: gofmt -w .
|
|
language: golang
|
|
types: [go]
|
|
# - id: check-x
|
|
# name: Check X
|
|
# entry: ./bin/check-x.sh
|
|
# language: script
|
|
# files: \.x$
|