|
| 1 | +run: |
| 2 | + # timeout for analysis, e.g. 30s, 5m, default is 1m |
| 3 | + timeout: 3m |
| 4 | + |
| 5 | + # default is true. Enables skipping of directories: |
| 6 | + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
| 7 | + skip-dirs-use-default: true |
| 8 | + |
| 9 | + # by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules": |
| 10 | + # If invoked with -mod=readonly, the go command is disallowed from the implicit |
| 11 | + # automatic updating of go.mod described above. Instead, it fails when any changes |
| 12 | + # to go.mod are needed. This setting is most useful to check that go.mod does |
| 13 | + # not need updates, such as in a continuous integration and testing system. |
| 14 | + # If invoked with -mod=vendor, the go command assumes that the vendor |
| 15 | + # directory holds the correct copies of dependencies and ignores |
| 16 | + # the dependency descriptions in go.mod. |
| 17 | + modules-download-mode: readonly |
| 18 | + |
| 19 | + # Allow multiple parallel golangci-lint instances running. |
| 20 | + # If false (default) - golangci-lint acquires file lock on start. |
| 21 | + allow-parallel-runners: true |
| 22 | + |
| 23 | + # which files to skip: they will be analyzed, but issues from them |
| 24 | + # won't be reported. Default value is empty list, but there is |
| 25 | + # no need to include all autogenerated files, we confidently recognize |
| 26 | + # autogenerated files. If it's not please let us know. |
| 27 | + skip-files: |
| 28 | + - "^.*\\_mock\\.go$" |
| 29 | + - "^.*\\.pb\\.go$" |
| 30 | + |
| 31 | +linters: |
| 32 | + disable-all: true |
| 33 | + enable: |
| 34 | + - asciicheck |
| 35 | + - bodyclose |
| 36 | + - cyclop |
| 37 | + - deadcode |
| 38 | + - depguard |
| 39 | + - dogsled |
| 40 | + - dupl |
| 41 | + - durationcheck |
| 42 | + - errcheck |
| 43 | + - errorlint |
| 44 | + - exhaustive |
| 45 | + - exportloopref |
| 46 | + - forbidigo |
| 47 | + - forcetypeassert |
| 48 | + - funlen |
| 49 | + - gci |
| 50 | + - gas |
| 51 | + #- gochecknoglobals |
| 52 | + - gochecknoinits |
| 53 | + - gocognit |
| 54 | + - goconst |
| 55 | + - gocritic |
| 56 | + - gocyclo |
| 57 | + - godot |
| 58 | + - godox |
| 59 | + - goerr113 |
| 60 | + - gofmt |
| 61 | + - gofumpt |
| 62 | + - goimports |
| 63 | + - gomnd |
| 64 | + - goprintffuncname |
| 65 | + - gosec |
| 66 | + - gosimple |
| 67 | + - govet |
| 68 | + - ifshort |
| 69 | + - importas |
| 70 | + - ineffassign |
| 71 | + - lll |
| 72 | + - makezero |
| 73 | + - maligned |
| 74 | + - nakedret |
| 75 | + - nestif |
| 76 | + - nilerr |
| 77 | + - nlreturn |
| 78 | + - noctx |
| 79 | + - nolintlint |
| 80 | + - paralleltest |
| 81 | + - prealloc |
| 82 | + - predeclared |
| 83 | + - revive # instead of golint |
| 84 | + - rowserrcheck |
| 85 | + - scopelint |
| 86 | + - sqlclosecheck |
| 87 | + - staticcheck |
| 88 | + - structcheck |
| 89 | + - stylecheck # instead of golint |
| 90 | + - testpackage |
| 91 | + - thelper |
| 92 | + - tparallel |
| 93 | + - typecheck |
| 94 | + - unconvert |
| 95 | + - unparam |
| 96 | + - unused |
| 97 | + - varcheck |
| 98 | + - wastedassign |
| 99 | + - whitespace |
| 100 | + - wrapcheck |
| 101 | + - wsl |
| 102 | + |
| 103 | +linters-settings: |
| 104 | + errcheck: |
| 105 | + # report about not checking of errors in type assetions: `a := b.(MyStruct)`; |
| 106 | + # default is false: such cases aren't reported by default. |
| 107 | + check-type-assertions: true |
| 108 | + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
| 109 | + # default is false: such cases aren't reported by default. |
| 110 | + check-blank: false |
| 111 | + gocyclo: |
| 112 | + # minimal code complexity to report, 30 by default (but we recommend 10-20) |
| 113 | + min-complexity: 25 |
| 114 | + cyclop: |
| 115 | + # the maximal code complexity to report |
| 116 | + max-complexity: 25 |
| 117 | + # the maximal average package complexity. If it's higher than 0.0 (float) the check is enabled (default 0.0) |
| 118 | + package-average: 10.0 |
| 119 | + # should ignore tests (default false) |
| 120 | + skip-tests: false |
| 121 | + maligned: |
| 122 | + # print struct with more effective memory layout or not, false by default |
| 123 | + suggest-new: true |
| 124 | + dupl: |
| 125 | + # tokens count to trigger issue, 150 by default |
| 126 | + threshold: 110 |
| 127 | + gocognit: |
| 128 | + # minimal code complexity to report, 30 by default (but we recommend 10-20) |
| 129 | + min-complexity: 50 |
| 130 | + lll: |
| 131 | + # max line length, lines longer will be reported. Default is 120. |
| 132 | + # '\t' is counted as 1 character by default, and can be changed with the tab-width option |
| 133 | + line-length: 140 |
| 134 | + # tab width in spaces. Default to 1. |
| 135 | + tab-width: 4 |
| 136 | + wsl: |
| 137 | + # If true append is only allowed to be cuddled if appending value is |
| 138 | + # matching variables, fields or types on line above. Default is true. |
| 139 | + strict-append: true |
| 140 | + # Allow calls and assignments to be cuddled as long as the lines have any |
| 141 | + # matching variables, fields or types. Default is true. |
| 142 | + allow-assign-and-call: true |
| 143 | + # Allow multiline assignments to be cuddled. Default is true. |
| 144 | + allow-multiline-assign: true |
| 145 | + # Allow declarations (var) to be cuddled. |
| 146 | + allow-cuddle-declarations: true |
| 147 | + # Allow trailing comments in ending of blocks |
| 148 | + allow-trailing-comment: true |
| 149 | + # Force newlines in end of case at this limit (0 = never). |
| 150 | + force-case-trailing-whitespace: 0 |
| 151 | + funlen: |
| 152 | + lines: 100 |
| 153 | + statements: 50 |
| 154 | + |
| 155 | +issues: |
| 156 | + exclude: |
| 157 | + - composites |
| 158 | + |
| 159 | + # Excluding configuration per-path, per-linter, per-text and per-source |
| 160 | + exclude-rules: |
| 161 | + - path: _test\.go |
| 162 | + linters: |
| 163 | + - gomnd |
| 164 | + - scopelint |
| 165 | + - funlen |
| 166 | + - dupl |
| 167 | + - cyclop |
| 168 | + - lll |
| 169 | + |
| 170 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 171 | + max-issues-per-linter: 0 |
| 172 | + |
| 173 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 174 | + max-same-issues: 0 |
| 175 | + |
| 176 | + # Fix found issues (if it's supported by the linter) |
| 177 | + fix: true |
| 178 | + |
| 179 | +# golangci.com configuration |
| 180 | +# https://github.com/golangci/golangci/wiki/Configuration |
| 181 | +service: |
| 182 | + golangci-lint-version: 1.38.x # use the fixed version to not introduce new linters unexpectedly |
| 183 | + prepare: |
| 184 | + - echo "here I can run custom commands, but no preparation needed for this repo" |
0 commit comments