|
| 1 | +# More info on config here: https://github.com/golangci/golangci-lint#config-file |
| 2 | +run: |
| 3 | + deadline: 5m |
| 4 | + issues-exit-code: 1 |
| 5 | + tests: true |
| 6 | + skip-dirs: |
| 7 | + - .git |
| 8 | + - bin |
| 9 | + - vendor |
| 10 | + - node_modules |
| 11 | + - var |
| 12 | + - gen |
| 13 | + - tmp |
| 14 | + skip-files: |
| 15 | + - \.pb\.go$ |
| 16 | + - \.pb\.goclay\.go$ |
| 17 | + |
| 18 | +output: |
| 19 | + format: colored-line-number |
| 20 | + print-issued-lines: true |
| 21 | + print-linter-name: true |
| 22 | + |
| 23 | +linters-settings: |
| 24 | + errcheck: |
| 25 | + # report about not checking of errors in type assetions: `a := b.(MyStruct)`; |
| 26 | + # default is false: such cases aren't reported by default. |
| 27 | + check-type-assertions: true |
| 28 | + |
| 29 | + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
| 30 | + # default is false: such cases aren't reported by default. |
| 31 | + check-blank: true |
| 32 | + govet: |
| 33 | + check-shadowing: true |
| 34 | + golint: |
| 35 | + min-confidence: 0 |
| 36 | + dupl: |
| 37 | + threshold: 100 |
| 38 | + goconst: |
| 39 | + min-len: 2 |
| 40 | + min-occurrences: 2 |
| 41 | + maligned: |
| 42 | + # print struct with more effective memory layout or not, false by default |
| 43 | + suggest-new: true |
| 44 | + |
| 45 | +linters: |
| 46 | + disable-all: true |
| 47 | + enable: |
| 48 | + - golint |
| 49 | + - govet |
| 50 | + - errcheck |
| 51 | + - deadcode |
| 52 | + - structcheck |
| 53 | + - varcheck |
| 54 | + - ineffassign |
| 55 | + - typecheck |
| 56 | + - goconst |
| 57 | + - gocyclo |
| 58 | + - gofmt |
| 59 | + - goimports |
| 60 | + - gosec |
| 61 | + - megacheck # (staticcheck + gosimple + unused in one linter) |
| 62 | + - depguard |
| 63 | + - unconvert |
| 64 | + - unparam |
| 65 | + - unused |
| 66 | + - nakedret |
| 67 | + - maligned |
| 68 | + #- dupl |
| 69 | + |
| 70 | +issues: |
| 71 | + exclude-use-default: false |
| 72 | + exclude: |
| 73 | + # _ instead of err checks |
| 74 | + - G104 |
| 75 | + # for "public interface + private struct implementation" cases only! |
| 76 | + - exported func * returns unexported type *, which can be annoying to use |
| 77 | + # can be removed in the development phase |
| 78 | + # - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form) |
| 79 | + # not for the active development - can be removed in the stable phase |
| 80 | + - should have a package comment, unless it's in another file for this package |
| 81 | + - don't use an underscore in package name |
| 82 | + # errcheck: Almost all programs ignore errors on these functions and in most cases it's ok |
| 83 | + - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv|.*Rollback). is not checked |
| 84 | + - should check returned error before deferring |
0 commit comments