Skip to content

Commit

Permalink
ci: configure and enable GolangCI linters
Browse files Browse the repository at this point in the history
- Add `.golangci.yml` configuration file
- Enable specific linters including `bodyclose`, `errcheck`, `gofmt`, `govet`, and others
- Exclude certain linters for specific test files like `authenticator_test.go`, `parser_test.go`, and `signatureheader_test.go`
- Set the linter run timeout to 3 minutes

Signed-off-by: appleboy <[email protected]>
  • Loading branch information
appleboy committed Sep 27, 2024
1 parent f23b413 commit c394846
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
linters:
enable-all: false
disable-all: true
fast: false
enable:
- bodyclose
- dogsled
- dupl
- errcheck
- exportloopref
- exhaustive
- gochecknoinits
- goconst
- gocritic
- gocyclo
- gofmt
- goimports
- goprintffuncname
- gosec
- gosimple
- govet
- ineffassign
- lll
- misspell
- nakedret
- noctx
- nolintlint
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- gofumpt

issues:
exclude-rules:
- path: authenticator_test.go
linters:
- bodyclose
- unparam
- path: parser_test.go
linters:
- lll
- path: signatureheader_test.go
linters:
- lll
run:
timeout: 3m

0 comments on commit c394846

Please sign in to comment.