File tree 1 file changed +51
-8
lines changed
1 file changed +51
-8
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,16 @@ linters-settings:
18
18
gofmt :
19
19
# simplify code: gofmt with `-s` option, true by default
20
20
simplify : true
21
+ funlen :
22
+ # Checks the number of lines in a function.
23
+ # If lower than 0, disable the check.
24
+ lines : 200
25
+ # Checks the number of statements in a function.
26
+ statements : 80
27
+ gosec :
28
+ excludes :
29
+ - G402 # Look for bad TLS connection settings.
30
+ - G306 # Poor file permissions used when writing to a new file.
21
31
22
32
linters :
23
33
enable-all : true
@@ -32,16 +42,49 @@ linters:
32
42
# them even longer by marking them as 'nolint'.
33
43
- lll
34
44
35
- # We don't care (enough) about misaligned structs to lint that.
36
- - maligned
37
-
38
- # We have long functions, especially in tests. Moving or renaming those
39
- # would trigger funlen problems that we may not want to solve at that time.
40
- - funlen
45
+ # We don't require that all structs have all fields initialized when new
46
+ # instances are created.
47
+ - exhaustruct
41
48
42
- # Gosec is outdated and reports false positives.
43
- - gosec
49
+ # Deprecated linters. See https://golangci-lint.run/usage/linters/.
50
+ - interfacer
51
+ - golint
52
+ - maligned
53
+ - scopelint
54
+ - exhaustivestruct
55
+ - bodyclose
56
+ - contextcheck
57
+ - nilerr
58
+ - noctx
59
+ - rowserrcheck
60
+ - sqlclosecheck
61
+ - structcheck
62
+ - tparallel
63
+ - unparam
64
+ - wastedassign
65
+ - ifshort
66
+ - varcheck
67
+ - deadcode
68
+ - nosnakecase
44
69
45
70
issues :
46
71
# Only show newly introduced problems.
47
72
new-from-rev : 4008b92d81d4d62e663025c5f79ebe44b53f283c
73
+
74
+ exclude-rules :
75
+ # Exclude gosec from running for tests so that tests with weak randomness
76
+ # (math/rand) will pass the linter. We also exclude funlen from tests as
77
+ # have test functions that are intentionally long.
78
+ - path : _test\.go
79
+ linters :
80
+ - gosec
81
+ - funlen
82
+
83
+ - path : test*
84
+ linters :
85
+ - gosec
86
+ - funlen
87
+
88
+ - path : itest/.*
89
+ linters :
90
+ - paralleltest
You can’t perform that action at this time.
0 commit comments