chore: add Makefile

main
sudo pacman -Syu 2022-07-23 21:30:15 +07:00
parent 6c2cd0baac
commit a8ef4ca921
No known key found for this signature in database
GPG Key ID: D6CB5C6C567C47B0
2 changed files with 84 additions and 0 deletions

74
.golangci.yml Normal file
View File

@ -0,0 +1,74 @@
run:
tests: false
skip-dirs:
- ".*test.*"
- ".*mock.*"
- ".*generated.*"
- ".*example.*"
skip-files:
- ".*Mock.*"
- ".*_mock.*"
- ".*_generated.*"
go: "1.18"
output:
sort-results: true
linters:
disable-all: true
enable:
- deadcode
- errcheck
- gosimple
- govet
- staticcheck
- typecheck
- unused
- varcheck
- errname
- errorlint
- execinquery
- goerr113
- gofumpt
- gosec
- ifshort
- importas
- makezero
- nilnil
- prealloc
- unconvert
fast: true
linters-settings:
gosec:
excludes:
- G402
- G501
- G505
exclude-generated: true
govet:
check-shadowing: false
disable-all: true
enable:
- assign
- atomic
- bools
- buildtag
- composites
- copylocks
- fieldalignment
- httpresponse
- loopclosure
- lostcancel
- nilfunc
- printf
- unmarshal
- unreachable
- unusedresult
staticcheck:
go: "1.18"
checks: ["all", "-SA1019"]
issues:
new: true
fix: true

10
Makefile Normal file
View File

@ -0,0 +1,10 @@
.PHONY: all test-color lint
all: test-color lint
test-color:
go install github.com/haunt98/go-test-color@latest
go-test-color -race -failfast ./...
lint:
golangci-lint run ./...