Skip to content

Commit

Permalink
add golangci linters settings
Browse files Browse the repository at this point in the history
  • Loading branch information
sigua-cs committed Mar 21, 2022
1 parent 172d9b5 commit f949b56
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
run:
timeout: 3m
tests: false

linters:
enable:
- asciicheck
- bodyclose
- depguard
- dogsled
- dupl
- durationcheck
- errname
- errorlint
- exhaustive
- exportloopref
- forcetypeassert
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- gofumpt
- goheader
- goimports
- gomoddirectives
- gomodguard
- goprintffuncname
- gosec
- govet
- ifshort
- importas
- makezero
- megacheck
- misspell
- nakedret
- nilerr
- predeclared
- promlinter
- rowserrcheck
- sqlclosecheck
- testpackage
- thelper
- tparallel
- unconvert
- unparam
- wastedassign
- whitespace
disable:
# Should be readded in the future with a dedicated PR to do the fix
- cyclop
- funlen
- gocognit
- nolintlint
- revive
- stylecheck
- nestif

# Disabled with a reason
- gochecknoglobals # incompatible with the way we define our flags currently
- maligned # checker not supported anymore
- noctx # disabled because we do not plan to distribute this code as a library
- prealloc # we are not after some perf
- tagliatelle # disabled because we are dependant on external API that do not follow the right naming
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ lint:
go vet $(pkgs)
go list ./... | grep -v /vendor/ | xargs -n1 golint

tidy:
go mod tidy

deps:
go mod download

go-lint: deps tidy
golangci-lint run -v

reconfigure:
kill -HUP `pidof chproxy`

Expand Down

0 comments on commit f949b56

Please sign in to comment.