Skip to content

Commit 25833a8

Browse files
committed
chore: update linter
1 parent 46c2b75 commit 25833a8

File tree

4 files changed

+71
-70
lines changed

4 files changed

+71
-70
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build and test
33
on: [push, pull_request]
44

55
env:
6-
GOLANGCI_LINT_VERSION: v1.63.4
6+
GOLANGCI_LINT_VERSION: v2.0.2
77

88
jobs:
99
build:
@@ -25,7 +25,7 @@ jobs:
2525
git diff --exit-code go.sum
2626
2727
- name: Install golangci-lint ${{ env.GOLANGCI_LINT_VERSION }}
28-
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
28+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(go env GOPATH)/bin ${GOLANGCI_LINT_VERSION}
2929

3030
- name: Install Compose
3131
uses: ndeloof/install-compose-action@v0.0.1

.golangci.yml

Lines changed: 66 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
version: "2"
2+
3+
formatters:
4+
enable:
5+
- gci
6+
- gofumpt
7+
settings:
8+
gofumpt:
9+
extra-rules: false
10+
111
linters:
2-
disable-all: true
12+
default: none
313
enable:
414
- asasalint
515
- asciicheck
@@ -9,34 +19,27 @@ linters:
919
- depguard
1020
- dogsled
1121
- durationcheck
22+
- err113
1223
- errcheck
1324
- errname
14-
# - errorlint # TODO can be used in future. Required to check the current reported issues.
1525
- forbidigo
1626
- forcetypeassert
1727
- funlen
18-
- gci
1928
- gochecknoglobals
2029
- gocognit
2130
- goconst
2231
- gocritic
2332
- gocyclo
2433
- godot
2534
- godox
26-
- err113
27-
- gofmt
28-
- gofumpt
2935
- goheader
30-
- goimports
3136
- gomoddirectives
3237
- gomodguard
3338
- goprintffuncname
3439
- gosec
35-
- gosimple
3640
- govet
3741
- importas
3842
- ineffassign
39-
# - makezero # TODO can be used in future. Required to check the current reported issues.
4043
- misspell
4144
- nakedret
4245
- nestif
@@ -47,75 +50,71 @@ linters:
4750
- promlinter
4851
- revive
4952
- staticcheck
50-
- stylecheck
5153
- tagliatelle
52-
- tenv
5354
- thelper
5455
- unconvert
5556
- unparam
5657
- unused
5758
- usestdlibvars
5859
- wastedassign
5960
- whitespace
61+
# - errorlint # TODO can be used in future. Required to check the current reported issues.
62+
# - makezero # TODO can be used in future. Required to check the current reported issues.
63+
64+
settings:
65+
depguard:
66+
rules:
67+
main:
68+
deny:
69+
- pkg: github.com/instana/testify
70+
desc: not allowed
71+
- pkg: github.com/sirupsen/logrus
72+
desc: not allowed
73+
- pkg: github.com/pkg/errors
74+
desc: Should be replaced by standard lib errors package
75+
funlen:
76+
lines: -1
77+
statements: 40
78+
goconst:
79+
min-len: 5
80+
min-occurrences: 3
81+
gocritic:
82+
disabled-checks:
83+
- unnamedResult
84+
- sloppyReassign
85+
- rangeValCopy
86+
- octalLiteral
87+
- paramTypeCombine # already handle by gofumpt.extra-rules
88+
enabled-tags:
89+
- diagnostic
90+
- style
91+
- performance
92+
settings:
93+
hugeParam:
94+
sizeThreshold: 100
95+
gocyclo:
96+
min-complexity: 15
97+
godox:
98+
keywords:
99+
- FIXME
100+
gosec:
101+
excludes:
102+
- G115
103+
govet:
104+
disable:
105+
- fieldalignment
106+
enable-all: true
107+
misspell:
108+
locale: US
60109

61-
linters-settings:
62-
govet:
63-
enable-all: true
64-
disable:
65-
- fieldalignment
66-
gocyclo:
67-
min-complexity: 15
68-
goconst:
69-
min-len: 5
70-
min-occurrences: 3
71-
misspell:
72-
locale: US
73-
funlen:
74-
lines: -1
75-
statements: 40
76-
godox:
77-
keywords:
78-
- FIXME
79-
gofumpt:
80-
extra-rules: false
81-
depguard:
110+
exclusions:
111+
warn-unused: true
82112
rules:
83-
main:
84-
deny:
85-
- pkg: "github.com/instana/testify"
86-
desc: not allowed
87-
- pkg: "github.com/sirupsen/logrus"
88-
desc: not allowed
89-
- pkg: "github.com/pkg/errors"
90-
desc: Should be replaced by standard lib errors package
91-
gocritic:
92-
enabled-tags:
93-
- diagnostic
94-
- style
95-
- performance
96-
disabled-checks:
97-
- unnamedResult
98-
- sloppyReassign
99-
- rangeValCopy
100-
- octalLiteral
101-
- paramTypeCombine # already handle by gofumpt.extra-rules
102-
settings:
103-
hugeParam:
104-
sizeThreshold: 100
105-
gosec:
106-
excludes:
107-
- G115
113+
- linters:
114+
- funlen
115+
- goconst
116+
path: (.+)_test.go
108117

109118
issues:
110-
exclude-use-default: false
111119
max-issues-per-linter: 0
112120
max-same-issues: 0
113-
exclude: [ ]
114-
exclude-rules:
115-
- path: "(.+)_test.go"
116-
linters:
117-
- goconst
118-
- funlen
119-
120-
run:
121-
timeout: 5m

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kvtools/dynamodb
22

3-
go 1.19
3+
go 1.22
44

55
require (
66
github.com/aws/aws-sdk-go v1.44.91

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHW
99
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
1010
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
1111
github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs=
12+
github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
1213
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
1314
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
1415
github.com/kvtools/valkeyrie v1.0.0 h1:LAITop2wPoYCMitR24GZZsW0b57hmI+ePD18VRTtOf0=
@@ -27,6 +28,7 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
2728
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
2829
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
2930
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
31+
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3032
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
3133
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
3234
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)