40 lines
1.1 KiB
YAML
40 lines
1.1 KiB
YAML
# ABOUTME: Pre-commit hooks configuration for code quality checks
|
|
# ABOUTME: Runs formatting, linting, and tests before each commit
|
|
repos:
|
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
rev: v4.6.0
|
|
hooks:
|
|
- id: trailing-whitespace
|
|
- id: end-of-file-fixer
|
|
- id: check-yaml
|
|
- id: check-added-large-files
|
|
- id: check-merge-conflict
|
|
- id: mixed-line-ending
|
|
|
|
- repo: https://github.com/dnephin/pre-commit-golang
|
|
rev: v0.5.1
|
|
hooks:
|
|
- id: go-fmt
|
|
- id: go-imports
|
|
- id: go-mod-tidy
|
|
- id: golangci-lint
|
|
args: ['--timeout=5m']
|
|
- id: go-unit-tests
|
|
args: ['-race', '-v', './...']
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: go-mod-verify
|
|
name: go mod verify
|
|
entry: go mod verify
|
|
language: system
|
|
files: go\.(mod|sum)$
|
|
pass_filenames: false
|
|
|
|
- id: go-build-all
|
|
name: go build all binaries
|
|
entry: bash -c 'go build -v -o sendspin-player . && go build -v -o sendspin-server ./cmd/sendspin-server'
|
|
language: system
|
|
files: \.go$
|
|
pass_filenames: false
|