|
| 1 | +service: |
| 2 | + # When updating this, also update the version stored in docker/build-tools/Dockerfile in the multicloudlab/tools repo. |
| 3 | + golangci-lint-version: 1.18.x # use the fixed version to not introduce new linters unexpectedly |
| 4 | +run: |
| 5 | + # timeout for analysis, e.g. 30s, 5m, default is 1m |
| 6 | + deadline: 20m |
| 7 | + |
| 8 | + # which dirs to skip: they won't be analyzed; |
| 9 | + # can use regexp here: generated.*, regexp is applied on full path; |
| 10 | + # default value is empty list, but next dirs are always skipped independently |
| 11 | + # from this option's value: |
| 12 | + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
| 13 | + skip-dirs: |
| 14 | + - genfiles$ |
| 15 | + - vendor$ |
| 16 | + - bindata$ |
| 17 | + |
| 18 | + # which files to skip: they will be analyzed, but issues from them |
| 19 | + # won't be reported. Default value is empty list, but there is |
| 20 | + # no need to include all autogenerated files, we confidently recognize |
| 21 | + # autogenerated files. If it's not please let us know. |
| 22 | + skip-files: |
| 23 | + - ".*\\.pb\\.go" |
| 24 | + - ".*\\.gen\\.go" |
| 25 | + |
| 26 | +linters: |
| 27 | + # please, do not use `enable-all`: it's deprecated and will be removed soon. |
| 28 | + # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint |
| 29 | + disable-all: true |
| 30 | + enable: |
| 31 | + - deadcode |
| 32 | + - errcheck |
| 33 | + - goconst |
| 34 | + - gocritic |
| 35 | + - gocyclo |
| 36 | + - gofmt |
| 37 | + - goimports |
| 38 | + - golint |
| 39 | + - gosec |
| 40 | + - gosimple |
| 41 | + - govet |
| 42 | + - ineffassign |
| 43 | + - interfacer |
| 44 | + - lll |
| 45 | + - misspell |
| 46 | + - staticcheck |
| 47 | + - structcheck |
| 48 | + - stylecheck |
| 49 | + - typecheck |
| 50 | + - unconvert |
| 51 | + - unparam |
| 52 | + - unused |
| 53 | + - varcheck |
| 54 | + # don't enable: |
| 55 | + # - bodyclose |
| 56 | + # - depguard |
| 57 | + # - dogsled |
| 58 | + # - dupl |
| 59 | + # - funlen |
| 60 | + # - gochecknoglobals |
| 61 | + # - gochecknoinits |
| 62 | + # - gocognit |
| 63 | + # - godox |
| 64 | + # - maligned |
| 65 | + # - nakedret |
| 66 | + # - prealloc |
| 67 | + # - scopelint |
| 68 | + # - whitespace |
| 69 | + |
| 70 | +linters-settings: |
| 71 | + errcheck: |
| 72 | + # report about not checking of errors in type assetions: `a := b.(MyStruct)`; |
| 73 | + # default is false: such cases aren't reported by default. |
| 74 | + check-type-assertions: false |
| 75 | + |
| 76 | + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
| 77 | + # default is false: such cases aren't reported by default. |
| 78 | + check-blank: false |
| 79 | + govet: |
| 80 | + # report about shadowed variables |
| 81 | + check-shadowing: false |
| 82 | + golint: |
| 83 | + # minimal confidence for issues, default is 0.8 |
| 84 | + min-confidence: 0.0 |
| 85 | + gofmt: |
| 86 | + # simplify code: gofmt with `-s` option, true by default |
| 87 | + simplify: true |
| 88 | + goimports: |
| 89 | + # put imports beginning with prefix after 3rd-party packages; |
| 90 | + # it's a comma-separated list of prefixes |
| 91 | + local-prefixes: github.com/IBM/ |
| 92 | + maligned: |
| 93 | + # print struct with more effective memory layout or not, false by default |
| 94 | + suggest-new: true |
| 95 | + misspell: |
| 96 | + # Correct spellings using locale preferences for US or UK. |
| 97 | + # Default is to use a neutral variety of English. |
| 98 | + # Setting locale to US will correct the British spelling of 'colour' to 'color'. |
| 99 | + locale: US |
| 100 | + ignore-words: |
| 101 | + - cancelled |
| 102 | + lll: |
| 103 | + # max line length, lines longer will be reported. Default is 120. |
| 104 | + # '\t' is counted as 1 character by default, and can be changed with the tab-width option |
| 105 | + line-length: 160 |
| 106 | + # tab width in spaces. Default to 1. |
| 107 | + tab-width: 1 |
| 108 | + unused: |
| 109 | + # treat code as a program (not a library) and report unused exported identifiers; default is false. |
| 110 | + # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: |
| 111 | + # if it's called for subdir of a project it can't find funcs usages. All text editor integrations |
| 112 | + # with golangci-lint call it on a directory with the changed file. |
| 113 | + check-exported: false |
| 114 | + unparam: |
| 115 | + # call graph construction algorithm (cha, rta). In general, use cha for libraries, |
| 116 | + # and rta for programs with main packages. Default is cha. |
| 117 | + algo: cha |
| 118 | + |
| 119 | + # Inspect exported functions, default is false. Set to true if no external program/library imports your code. |
| 120 | + # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: |
| 121 | + # if it's called for subdir of a project it can't find external interfaces. All text editor integrations |
| 122 | + # with golangci-lint call it on a directory with the changed file. |
| 123 | + check-exported: false |
| 124 | + gocritic: |
| 125 | + enabled-checks: |
| 126 | + - appendCombine |
| 127 | + - argOrder |
| 128 | + - assignOp |
| 129 | + - badCond |
| 130 | + - boolExprSimplify |
| 131 | + - builtinShadow |
| 132 | + - captLocal |
| 133 | + - caseOrder |
| 134 | + - codegenComment |
| 135 | + - commentedOutCode |
| 136 | + - commentedOutImport |
| 137 | + - defaultCaseOrder |
| 138 | + - deprecatedComment |
| 139 | + - docStub |
| 140 | + - dupArg |
| 141 | + - dupBranchBody |
| 142 | + - dupCase |
| 143 | + - dupSubExpr |
| 144 | + - elseif |
| 145 | + - emptyFallthrough |
| 146 | + - equalFold |
| 147 | + - flagDeref |
| 148 | + - flagName |
| 149 | + - hexLiteral |
| 150 | + - indexAlloc |
| 151 | + - initClause |
| 152 | + - methodExprCall |
| 153 | + - nilValReturn |
| 154 | + - octalLiteral |
| 155 | + - offBy1 |
| 156 | + - rangeExprCopy |
| 157 | + - regexpMust |
| 158 | + - sloppyLen |
| 159 | + - stringXbytes |
| 160 | + - switchTrue |
| 161 | + - typeAssertChain |
| 162 | + - typeSwitchVar |
| 163 | + - typeUnparen |
| 164 | + - underef |
| 165 | + - unlambda |
| 166 | + - unnecessaryBlock |
| 167 | + - unslice |
| 168 | + - valSwap |
| 169 | + - weakCond |
| 170 | + |
| 171 | + # Unused |
| 172 | + # - yodaStyleExpr |
| 173 | + # - appendAssign |
| 174 | + # - commentFormatting |
| 175 | + # - emptyStringTest |
| 176 | + # - exitAfterDefer |
| 177 | + # - ifElseChain |
| 178 | + # - hugeParam |
| 179 | + # - importShadow |
| 180 | + # - nestingReduce |
| 181 | + # - paramTypeCombine |
| 182 | + # - ptrToRefParam |
| 183 | + # - rangeValCopy |
| 184 | + # - singleCaseSwitch |
| 185 | + # - sloppyReassign |
| 186 | + # - unlabelStmt |
| 187 | + # - unnamedResult |
| 188 | + # - wrapperFunc |
| 189 | + |
| 190 | +issues: |
| 191 | + # List of regexps of issue texts to exclude, empty list by default. |
| 192 | + # But independently from this option we use default exclude patterns, |
| 193 | + # it can be disabled by `exclude-use-default: false`. To list all |
| 194 | + # excluded by default patterns execute `golangci-lint run --help` |
| 195 | + exclude: |
| 196 | + - composite literal uses unkeyed fields |
| 197 | + |
| 198 | + exclude-rules: |
| 199 | + # Exclude some linters from running on test files. |
| 200 | + - path: _test\.go$|^tests/|^samples/ |
| 201 | + linters: |
| 202 | + - errcheck |
| 203 | + - maligned |
| 204 | + |
| 205 | + # Independently from option `exclude` we use default exclude patterns, |
| 206 | + # it can be disabled by this option. To list all |
| 207 | + # excluded by default patterns execute `golangci-lint run --help`. |
| 208 | + # Default value for this option is true. |
| 209 | + exclude-use-default: true |
| 210 | + |
| 211 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 212 | + max-per-linter: 0 |
| 213 | + |
| 214 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 215 | + max-same-issues: 0 |
0 commit comments