Skip to content

Commit fadf83f

Browse files
committed
ci(lint): enable comprehensive Go linting and code quality checks
- Add .golangci.yml configuration file - Enable various linters including asciicheck, dogsled, durationcheck, errcheck, errorlint, exportloopref, gci, gofmt, goimports, gosec, misspell, nakedret, nilerr, perfsprint, revive, testifylint, usestdlibvars, and wastedassign - Configure gosec linter to exclude rule G402 - Configure perfsprint linter with specific settings for error handling, error formatting, integer conversion, sprintf optimization, and string concatenation - Enable all settings for testifylint linter Signed-off-by: appleboy <[email protected]>
1 parent aa4ae84 commit fadf83f

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

.golangci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
run:
2+
timeout: 5m
3+
linters:
4+
enable:
5+
- asciicheck
6+
- dogsled
7+
- durationcheck
8+
- errcheck
9+
- errorlint
10+
- exportloopref
11+
- gci
12+
- gofmt
13+
- goimports
14+
- gosec
15+
- misspell
16+
- nakedret
17+
- nilerr
18+
- perfsprint
19+
- revive
20+
- testifylint
21+
- usestdlibvars
22+
- wastedassign
23+
24+
linters-settings:
25+
gosec:
26+
# To select a subset of rules to run.
27+
# Available rules: https://github.com/securego/gosec#available-rules
28+
# Default: [] - means include all rules
29+
includes: []
30+
# To exclude a subset of rules from running.
31+
# Default: [] - means exclude no rules
32+
excludes:
33+
- G402
34+
perfsprint:
35+
err-error: true
36+
errorf: true
37+
int-conversion: true
38+
sprintf1: true
39+
strconcat: true
40+
testifylint:
41+
enable-all: true

0 commit comments

Comments
 (0)