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