Skip to content

Commit

Permalink
add linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Maarten van der Heijden committed Sep 20, 2023
1 parent 6cd5d54 commit 614eeb4
Show file tree
Hide file tree
Showing 2 changed files with 92 additions and 1 deletion.
84 changes: 84 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
linters-settings:
gocritic:
enabled-tags:
- "performance"
- "style"
- "diagnostic"
linters:
enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- containedctx
- contextcheck
- cyclop
- decorder
- dogsled
- dupword
- durationcheck
- errcheck
- errname
- errorlint
- execinquery
- exhaustive
- exportloopref
- forbidigo
- ginkgolinter
- gocheckcompilerdirectives
- gochecknoinits
- gocognit
- goconst
- gocritic
- gocyclo
- goerr113
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- gosimple
- gosmopolitan
- govet
- grouper
- ifshort
- importas
- ineffassign
- interfacebloat
- interfacer
# - ireturn # We disable this one since we're returning any's anyway.
- loggercheck
- maintidx
- makezero
- mirror
- misspell
- musttag
- nakedret
- nestif
- nilerr
- nilnil
- nlreturn
- nonamedreturns
- nosprintfhostport
- paralleltest
- prealloc
- predeclared
- promlinter
- reassign
- rowserrcheck
- sqlclosecheck
- staticcheck
- tenv
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- usestdlibvars
- wastedassign
- whitespace
- zerologlint
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,11 @@ test: fmt ## Run unit tests, alias: t

fmt: ## Format go code
@go mod tidy
@go fmt ./...
@gofumpt -l -w .

tools: ## Install extra tools for development
go install mvdan.cc/gofumpt@latest
go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest

lint: ## Lint the code locally
golangci-lint run

0 comments on commit 614eeb4

Please sign in to comment.