Skip to content

Commit

Permalink
Add linting configuration file and linting script
Browse files Browse the repository at this point in the history
  • Loading branch information
ksysoev committed Aug 17, 2024
1 parent b0c4460 commit af634e3
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
linters-settings:
exhaustive:
default-signifies-exhaustive: true
errcheck:
check-type-assertions: true
goconst:
min-len: 2
min-occurrences: 3
gocritic:
enabled-tags:
- diagnostic
- experimental
- opinionated
- performance
- style
govet:
check-shadowing: true
enable:
- fieldalignment
nolintlint:
require-explanation: true
require-specific: true

linters:
disable-all: true
enable:
- bodyclose
- dogsled
- dupl
- errcheck
- exportloopref
- exhaustive
- goconst
- gocritic
- gofmt
- goimports
- gomnd
- gocyclo
- gosec
- gosimple
- govet
- ineffassign
- misspell
- nolintlint
- nakedret
- prealloc
- predeclared
- revive
- staticcheck
- stylecheck
- thelper
- tparallel
- typecheck
- unconvert
- unparam
- unused
- whitespace
- wsl

issues:
exclude-rules:
- path: _test\.go$
linters:
- goconst

run:
issues-exit-code: 1
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ coverage:
cat coverage.out | grep -v "/calls.go" | grep -v "custom_subscription_calls.go" | grep -v "subscription_calls.go" > coverage.final.out
go tool cover -func=coverage.final.out
rm coverage.out coverage.final.out

lint:
golangci-lint run

0 comments on commit af634e3

Please sign in to comment.