Skip to content

Commit 729b3f6

Browse files
committed
chore: renew checkers.
1 parent 40643c4 commit 729b3f6

File tree

6 files changed

+18
-47
lines changed

6 files changed

+18
-47
lines changed

.golangci.yaml

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
# see: https://github.com/golangci/golangci-lint/blob/master/.golangci.example.yml
22
run:
3-
skip-dirs:
4-
- ".github"
5-
- ".vscode"
3+
go: "1.22"
64

75
output:
86
sort-results: true
@@ -22,9 +20,6 @@ linters-settings:
2220
keywords:
2321
- "TODO"
2422
- "FIXME"
25-
ifshort:
26-
max-decl-lines: 1
27-
max-decl-chars: 60
2823
lll:
2924
line-length: 100
3025
tab-width: 4
@@ -36,8 +31,6 @@ linters-settings:
3631
- "some_word"
3732
nestif:
3833
min-complexity: 4
39-
staticcheck:
40-
go: "1.22"
4134
testpackage:
4235
skip-regexp: "_inner_test.go"
4336

@@ -46,29 +39,19 @@ linters:
4639
- "depguard"
4740
- "varnamelen"
4841
# ---- deprecated ---- #
49-
- "deadcode"
50-
- "exhaustivestruct"
51-
- "golint"
52-
- "ifshort"
53-
- "interfacer"
54-
- "maligned"
55-
- "nosnakecase"
42+
- "execinquery"
43+
- "gomnd"
5644
- "rowserrcheck"
57-
- "scopelint"
5845
- "sqlclosecheck"
59-
- "structcheck"
60-
- "varcheck"
6146
- "wastedassign"
6247
# -------------------- #
63-
presets:
64-
- "bugs"
65-
- "complexity"
66-
- "format"
67-
- "performance"
68-
- "style"
69-
- "unused"
48+
enable-all: true
7049
fast: false
50+
7151
issues:
52+
exclude-dirs:
53+
- ".github"
54+
- ".vscode"
7255
exclude-rules:
7356
# Exclude some linters from running on tests files.
7457
- path: "_test.go"

.vscode/cspell.json

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,47 +15,34 @@
1515
"language": "en",
1616
"minWordLength": 4,
1717
"words": [
18-
"authordate",
1918
"buildvcs",
2019
"cyclop",
21-
"deadcode",
2220
"depguard",
2321
"dupl",
24-
"errcheck",
25-
"exhaustivestruct",
22+
"execinquery",
2623
"funlen",
2724
"gocognit",
2825
"gocyclo",
2926
"godox",
3027
"goimports",
3128
"golangci",
32-
"golint",
29+
"gomnd",
3330
"gomod",
34-
"gomodcache",
3531
"guyarb",
3632
"httprouter",
37-
"ifndef",
38-
"ifshort",
39-
"interfacer",
4033
"julienschmidt",
4134
"maintidx",
42-
"makeflags",
4335
"makezero",
44-
"middlewares",
4536
"mythrnr",
4637
"nestif",
47-
"nosnakecase",
38+
"nolint",
4839
"rowserrcheck",
49-
"scopelint",
5040
"sonatype",
5141
"sonatypecommunity",
5242
"sqlclosecheck",
53-
"staticcheck",
5443
"stretchr",
55-
"structcheck",
44+
"testableexamples",
5645
"testpackage",
57-
"unimported",
58-
"varcheck",
5946
"varnamelen",
6047
"wastedassign"
6148
]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ fmt:
1616
.PHONY: lint
1717
lint:
1818
docker pull golangci/golangci-lint:latest > /dev/null \
19-
&& mkdir -p .cache/golangci-lint \
19+
&& mkdir -p .cache/golangci-lint .cache/go-build \
2020
&& docker run --rm \
2121
-v $(pwd):/app \
2222
-v $(pwd)/.cache:/root/.cache \
@@ -43,7 +43,7 @@ spell-check:
4343
&& docker run --rm \
4444
-v $(pwd):/workdir \
4545
ghcr.io/streetsidesoftware/cspell:latest \
46-
--config .vscode/cspell.json "**"
46+
--config /workdir/.vscode/cspell.json "**"
4747

4848
.PHONY: test
4949
test:

example_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
group "github.com/mythrnr/httprouter-group"
1010
)
1111

12+
//nolint:testableexamples
1213
func Example() {
1314
// first, define routes, handlers, and middlewares.
1415
g := group.New("/").GET(

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.20
44

55
require (
66
github.com/julienschmidt/httprouter v1.3.0
7-
github.com/stretchr/testify v1.8.4
7+
github.com/stretchr/testify v1.9.0
88
)
99

1010
require (

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4d
44
github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM=
55
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
66
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
7-
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
8-
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
7+
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
8+
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
99
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
1010
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
1111
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

0 commit comments

Comments
 (0)