Skip to content

Commit

Permalink
golangci-lint: update rules to match core
Browse files Browse the repository at this point in the history
  • Loading branch information
jmank88 committed Apr 30, 2024
1 parent e2884e3 commit 97be3d8
Showing 1 changed file with 36 additions and 4 deletions.
40 changes: 36 additions & 4 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ linters:
- misspell
- rowserrcheck
- errorlint
- unconvert
- sqlclosecheck
- noctx
- depguard
linters-settings:
exhaustive:
default-signifies-exhaustive: true
Expand All @@ -26,7 +30,7 @@ linters-settings:
# - G404
govet:
# report about shadowed variables
check-shadowing: false
check-shadowing: true
errorlint:
# Allow formatting of errors without %w
errorf: false
Expand All @@ -40,9 +44,10 @@ linters-settings:
- name: error-return
- name: error-strings
- name: error-naming
- name: exported
- name: if-return
- name: increment-decrement
# - name: var-naming
- name: var-naming
- name: var-declaration
- name: package-comments
- name: range
Expand All @@ -61,20 +66,47 @@ linters-settings:
- name: struct-tag
# - name: string-format
- name: string-of-int
# - name: range-val-address
- name: range-val-address
- name: range-val-in-closure
- name: modifies-value-receiver
- name: modifies-parameter
- name: identical-branches
- name: get-return
# - name: flag-parameter
# - name: early-return
- name: early-return
- name: defer
- name: constant-logical-expr
# - name: confusing-naming
# - name: confusing-results
- name: bool-literal-in-expr
- name: atomic
depguard:
rules:
main:
list-mode: lax
deny:
- pkg: cosmossdk.io/errors
desc: Use the standard library instead
- pkg: github.com/gofrs/uuid
desc: Use github.com/google/uuid instead
- pkg: github.com/satori/go.uuid
desc: Use github.com/google/uuid instead
- pkg: github.com/test-go/testify/assert
desc: Use github.com/stretchr/testify/assert instead
- pkg: github.com/test-go/testify/mock
desc: Use github.com/stretchr/testify/mock instead
- pkg: github.com/test-go/testify/require
desc: Use github.com/stretchr/testify/require instead
- pkg: go.uber.org/multierr
desc: Use the standard library instead, for example https://pkg.go.dev/errors#Join
- pkg: gopkg.in/guregu/null.v1
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: gopkg.in/guregu/null.v2
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: gopkg.in/guregu/null.v3
desc: Use gopkg.in/guregu/null.v4 instead
- pkg: github.com/go-gorm/gorm
desc: Use github.com/jmoiron/sqlx directly instead
issues:
exclude-rules:
- path: test
Expand Down

0 comments on commit 97be3d8

Please sign in to comment.