mirror of
https://github.com/ddworken/hishtory.git
synced 2025-01-13 17:58:50 +01:00
Add make fmt to pre-commit
This commit is contained in:
parent
decba84d9b
commit
e031af218a
@ -2,11 +2,8 @@ repos:
|
||||
- repo: https://github.com/Bahjat/pre-commit-golang
|
||||
rev: a4be1d0f860565649a450a8d480e541844c14a07
|
||||
hooks:
|
||||
- id: go-fmt-import
|
||||
- id: go-vet
|
||||
- id: gofumpt # requires github.com/mvdan/gofumpt
|
||||
- id: go-static-check # install https://staticcheck.io/docs/
|
||||
exclude: /vndor/
|
||||
- id: golangci-lint # requires github.com/golangci/golangci-lint
|
||||
- repo: local
|
||||
hooks:
|
||||
@ -15,3 +12,8 @@ repos:
|
||||
entry: errcheck -exclude .errcheck_excludes.txt ./...
|
||||
language: system
|
||||
pass_filenames: false
|
||||
- id: make-fmt # requires 'go install mvdan.cc/gofumpt@latest' and 'go install github.com/daixiang0/gci@latest'
|
||||
name: make-fmt
|
||||
entry: make fmt
|
||||
language: system
|
||||
pass_filenames: false
|
||||
|
2
Makefile
2
Makefile
@ -1,7 +1,7 @@
|
||||
help: ## Show this help.
|
||||
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
|
||||
|
||||
fmt:
|
||||
fmt: ## Format all files
|
||||
gofumpt -l -w -extra .
|
||||
gci write --custom-order -s standard -s 'Prefix(github.com/ddworken/hishtory)' -s default .
|
||||
|
||||
|
@ -6,6 +6,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/ddworken/hishtory/shared/testutils"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user