|
| 1 | +version: "2" |
| 2 | + |
1 | 3 | run: |
2 | | - deadline: 10m |
| 4 | + timeout: 10m |
3 | 5 | issues-exit-code: 1 |
4 | 6 | tests: true |
5 | 7 |
|
6 | | - |
7 | 8 | linters: |
8 | 9 | enable: |
9 | 10 | - bodyclose # find unclosed http response bodies |
10 | 11 | - dogsled # checks for too many ignored arguments |
11 | 12 | - durationcheck # verifies whether durations are multiplied, usually a mistake |
12 | 13 | - gocritic # checks for style, performance issues, and common programming errors |
13 | | - - gofmt # sanity check formatting |
14 | | - - goprintffuncname # checks that printf-like functions are named with `f` at the end [fast: true, auto-fix: false] |
| 14 | + - goprintffuncname # checks that printf-like functions are named with `f` at the end |
15 | 15 | - govet # check standard vet rules |
16 | 16 | - importas # verify that imports are consistent |
17 | 17 | - ineffassign # find ineffective assignments |
@@ -44,114 +44,64 @@ linters: |
44 | 44 | - exhaustive # doesn't handle default case |
45 | 45 | - forbidigo # not useful |
46 | 46 | - funlen # no limit on func length |
47 | | - - gci # we have custom import checking |
48 | 47 | - gocognit # this complexity is not a good metric |
49 | 48 | - goconst # check for things that could be replaced by constants |
50 | 49 | - gocyclo # this complexity is not a good metric |
51 | 50 | - godox # too many false positivies |
52 | 51 | - goheader # separate tool |
53 | | - - goimports # disabled, because it's slow, using scripts/check-imports.go instead. |
54 | 52 | - gomoddirectives # not useful |
55 | 53 | - gomodguard # not useful |
56 | 54 | - gosec # needs tweaking |
57 | | - - gosimple # part of staticcheck |
58 | 55 | - lll # don't need this check |
59 | 56 | - nlreturn # non-important code style |
60 | 57 | - paralleltest # too many false positives |
61 | 58 | - predeclared # kind of useful, but not critical |
62 | 59 | - promlinter # not relevant |
63 | | - - rowserrcheck # checks if sql.Rows.Err is checked correctly - Disabled because it reports false positive with defer statements after Query call |
64 | 60 | - sqlclosecheck # we have tagsql, which checks this better |
65 | 61 | - staticcheck # we use the separate staticcheck binary already |
66 | | - - stylecheck # has false positives |
67 | 62 | - tagliatelle # not our style |
68 | 63 | - testpackage # sometimes it's useful to have tests on private funcs |
69 | 64 | - thelper # too many false positives |
70 | 65 | - tparallel # false positivies |
71 | 66 | - unused # part of staticcheck |
72 | 67 | - wrapcheck # too much noise and false positives |
73 | 68 | - wsl # too much noise |
74 | | - fast: false |
| 69 | + settings: |
| 70 | + errcheck: |
| 71 | + check-type-assertions: false |
| 72 | + check-blank: false |
| 73 | + govet: {} |
| 74 | + gocritic: |
| 75 | + disabled-checks: |
| 76 | + - ifElseChain |
| 77 | + gocyclo: |
| 78 | + min-complexity: 10 |
| 79 | + dupl: |
| 80 | + threshold: 150 |
| 81 | + goconst: |
| 82 | + min-len: 3 |
| 83 | + min-occurrences: 3 |
| 84 | + lll: |
| 85 | + line-length: 140 |
| 86 | + tab-width: 1 |
| 87 | + unparam: |
| 88 | + check-exported: false |
| 89 | + nakedret: |
| 90 | + max-func-lines: 30 |
| 91 | + prealloc: |
| 92 | + simple: true |
| 93 | + range-loops: true |
| 94 | + for-loops: false |
| 95 | + |
| 96 | +formatters: |
| 97 | + enable: |
| 98 | + - gofmt # sanity check formatting |
75 | 99 |
|
76 | 100 | output: |
77 | 101 | formats: |
78 | | - - format: colored-line-number |
79 | | - print-issued-lines: true |
80 | | - print-linter-name: true |
81 | | - |
82 | | -linters-settings: |
83 | | - errcheck: |
84 | | - # report about not checking of errors in type assetions: `a := b.(MyStruct)`; |
85 | | - # default is false: such cases aren't reported by default. |
86 | | - check-type-assertions: false |
87 | | - |
88 | | - # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
89 | | - # default is false: such cases aren't reported by default. |
90 | | - check-blank: false |
91 | | - govet: |
92 | | - # report about shadowed variables |
93 | | - #TODO# check-shadowing: true |
94 | | - |
95 | | - # Obtain type information from installed (to $GOPATH/pkg) package files: |
96 | | - # golangci-lint will execute `go install -i` and `go test -i` for analyzed packages |
97 | | - # before analyzing them. |
98 | | - # Enable this option only if all conditions are met: |
99 | | - # 1. you use only "fast" linters (--fast e.g.): no program loading occurs |
100 | | - # 2. you use go >= 1.10 |
101 | | - # 3. you do repeated runs (false for CI) or cache $GOPATH/pkg or `go env GOCACHE` dir in CI. |
102 | | - use-installed-packages: false |
103 | | - gocritic: |
104 | | - disabled-checks: |
105 | | - - ifElseChain |
106 | | - goimports: |
107 | | - local: "storj.io" |
108 | | - golint: |
109 | | - min-confidence: 0.8 |
110 | | - gofmt: |
111 | | - simplify: true |
112 | | - gocyclo: |
113 | | - min-complexity: 10 |
114 | | - dupl: |
115 | | - threshold: 150 |
116 | | - goconst: |
117 | | - min-len: 3 |
118 | | - min-occurrences: 3 |
119 | | - misspell: |
120 | | - lll: |
121 | | - line-length: 140 |
122 | | - tab-width: 1 |
123 | | - unused: |
124 | | - # treat code as a program (not a library) and report unused exported identifiers; default is false. |
125 | | - # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: |
126 | | - # if it's called for subdir of a project it can't find funcs usages. All text editor integrations |
127 | | - # with golangci-lint call it on a directory with the changed file. |
128 | | - check-exported: false |
129 | | - unparam: |
130 | | - # call graph construction algorithm (cha, rta). In general, use cha for libraries, |
131 | | - # and rta for programs with main packages. Default is cha. |
132 | | - algo: cha |
133 | | - |
134 | | - # Inspect exported functions, default is false. Set to true if no external program/library imports your code. |
135 | | - # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: |
136 | | - # if it's called for subdir of a project it can't find external interfaces. All text editor integrations |
137 | | - # with golangci-lint call it on a directory with the changed file. |
138 | | - check-exported: false |
139 | | - nakedret: |
140 | | - # make an issue if func has more lines of code than this setting and it has naked returns; default is 30 |
141 | | - max-func-lines: 30 |
142 | | - prealloc: |
143 | | - # Report preallocation suggestions only on simple loops that have no returns/breaks/continues/gotos in them. |
144 | | - # True by default. |
145 | | - simple: true |
146 | | - range-loops: true # Report preallocation suggestions on range loops, true by default |
147 | | - for-loops: false # Report preallocation suggestions on for loops, false by default |
| 102 | + text: {} |
148 | 103 |
|
149 | 104 | issues: |
150 | 105 | max-issues-per-linter: 0 |
151 | 106 | max-same-issues: 0 |
152 | 107 | new: false |
153 | | - exclude-use-default: false |
154 | | - exclude-files: |
155 | | - - ".*\\.pb\\.go$" |
156 | | - - ".*\\.dbx\\.go$" |
157 | | - - "cmd/protoc-gen-go-drpc/.*" |
0 commit comments