added linter
This commit is contained in:
parent
22720169a2
commit
fb826919a6
40
scnserver/.golangci.yml
Normal file
40
scnserver/.golangci.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# https://golangci-lint.run/usage/configuration/
|
||||||
|
|
||||||
|
run:
|
||||||
|
go: '1.20'
|
||||||
|
|
||||||
|
linters:
|
||||||
|
enable-all: true
|
||||||
|
disable:
|
||||||
|
- golint # deprecated
|
||||||
|
- exhaustivestruct # deprecated
|
||||||
|
- deadcode # deprecated
|
||||||
|
- scopelint # deprecated
|
||||||
|
- structcheck # deprecated
|
||||||
|
- varcheck # deprecated
|
||||||
|
- nosnakecase # deprecated
|
||||||
|
- maligned # deprecated
|
||||||
|
- interfacer # deprecated
|
||||||
|
- ifshort # deprecated
|
||||||
|
- dupl # (i disagree)
|
||||||
|
- ireturn # (i disagree)
|
||||||
|
- wrapcheck # (waiting for bferr)
|
||||||
|
- goerr113 # (waiting for bferr)
|
||||||
|
- varnamelen # (too many false-positives)
|
||||||
|
- gomnd # (i disagree)
|
||||||
|
- depguard # (not configured)
|
||||||
|
- gofumpt # (we do not use gofumpt)
|
||||||
|
- gci # (we do no use gci)
|
||||||
|
- lll # (i disagree)
|
||||||
|
- gochecknoglobals # (i disagree)
|
||||||
|
|
||||||
|
issues:
|
||||||
|
exclude-rules:
|
||||||
|
- path: api/handler/.*.go
|
||||||
|
linters:
|
||||||
|
- funlen
|
||||||
|
|
||||||
|
linters-settings:
|
||||||
|
tagalign:
|
||||||
|
align: true
|
||||||
|
sort: false
|
@ -5,7 +5,7 @@ PORT=9090
|
|||||||
NAMESPACE=$(shell git rev-parse --abbrev-ref HEAD)
|
NAMESPACE=$(shell git rev-parse --abbrev-ref HEAD)
|
||||||
HASH=$(shell git rev-parse HEAD)
|
HASH=$(shell git rev-parse HEAD)
|
||||||
|
|
||||||
.PHONY: test swagger pygmentize docker
|
.PHONY: test swagger pygmentize docker migrate dgi pygmentize lint
|
||||||
|
|
||||||
build: swagger pygmentize fmt
|
build: swagger pygmentize fmt
|
||||||
mkdir -p _build
|
mkdir -p _build
|
||||||
@ -91,3 +91,8 @@ migrate:
|
|||||||
CGO_ENABLED=1 go build -v -o _build/scn_migrate -tags "timetzdata sqlite_fts5 sqlite_foreign_keys" ./cmd/migrate
|
CGO_ENABLED=1 go build -v -o _build/scn_migrate -tags "timetzdata sqlite_fts5 sqlite_foreign_keys" ./cmd/migrate
|
||||||
./_build/scn_migrate
|
./_build/scn_migrate
|
||||||
|
|
||||||
|
lint:
|
||||||
|
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.53.2
|
||||||
|
golangci-lint run ./...
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user