|
| 1 | +run: |
| 2 | + concurrency: 4 |
| 3 | + |
| 4 | + # timeout for analysis, e.g. 30s, 5m, default is 1m |
| 5 | + deadline: 10m |
| 6 | + |
| 7 | + # which dirs to skip: they won't be analyzed; |
| 8 | + # can use regexp here: generated.*, regexp is applied on full path; |
| 9 | + # default value is empty list, but next dirs are always skipped independently |
| 10 | + # from this option's value: |
| 11 | + # vendor$, third_party$, testdata$, examples$, Godeps$, builtin$ |
| 12 | + skip-dirs: |
| 13 | + - genfiles$ |
| 14 | + - vendor$ |
| 15 | + |
| 16 | + # which files to skip: they will be analyzed, but issues from them |
| 17 | + # won't be reported. Default value is empty list, but there is |
| 18 | + # no need to include all autogenerated files, we confidently recognize |
| 19 | + # autogenerated files. If it's not please let us know. |
| 20 | + skip-files: |
| 21 | + - ".*\\.pb\\.go" |
| 22 | + - ".*\\.gen\\.go" |
| 23 | + |
| 24 | +linters: |
| 25 | + enable-all: true |
| 26 | + disable: |
| 27 | + - depguard |
| 28 | + - dupl |
| 29 | + - gochecknoglobals |
| 30 | + - gochecknoinits |
| 31 | + - goconst |
| 32 | + - gocyclo |
| 33 | + - gosec |
| 34 | + - nakedret |
| 35 | + - prealloc |
| 36 | + - scopelint |
| 37 | + fast: false |
| 38 | + |
| 39 | +linters-settings: |
| 40 | + errcheck: |
| 41 | + # report about not checking of errors in type assetions: `a := b.(MyStruct)`; |
| 42 | + # default is false: such cases aren't reported by default. |
| 43 | + check-type-assertions: false |
| 44 | + |
| 45 | + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; |
| 46 | + # default is false: such cases aren't reported by default. |
| 47 | + check-blank: false |
| 48 | + govet: |
| 49 | + # report about shadowed variables |
| 50 | + check-shadowing: false |
| 51 | + golint: |
| 52 | + # minimal confidence for issues, default is 0.8 |
| 53 | + min-confidence: 0.0 |
| 54 | + gofmt: |
| 55 | + # simplify code: gofmt with `-s` option, true by default |
| 56 | + simplify: true |
| 57 | + goimports: |
| 58 | + # put imports beginning with prefix after 3rd-party packages; |
| 59 | + # it's a comma-separated list of prefixes |
| 60 | + local-prefixes: istio.io/ |
| 61 | + maligned: |
| 62 | + # print struct with more effective memory layout or not, false by default |
| 63 | + suggest-new: true |
| 64 | + dupl: |
| 65 | + # tokens count to trigger issue, 150 by default |
| 66 | + threshold: 100 |
| 67 | + goconst: |
| 68 | + # minimal length of string constant, 3 by default |
| 69 | + min-len: 3 |
| 70 | + # minimal occurrences count to trigger, 3 by default |
| 71 | + min-occurrences: 3 |
| 72 | + misspell: |
| 73 | + # Correct spellings using locale preferences for US or UK. |
| 74 | + # Default is to use a neutral variety of English. |
| 75 | + # Setting locale to US will correct the British spelling of 'colour' to 'color'. |
| 76 | + locale: US |
| 77 | + lll: |
| 78 | + # max line length, lines longer will be reported. Default is 120. |
| 79 | + # '\t' is counted as 1 character by default, and can be changed with the tab-width option |
| 80 | + line-length: 160 |
| 81 | + # tab width in spaces. Default to 1. |
| 82 | + tab-width: 1 |
| 83 | + unused: |
| 84 | + # treat code as a program (not a library) and report unused exported identifiers; default is false. |
| 85 | + # XXX: if you enable this setting, unused will report a lot of false-positives in text editors: |
| 86 | + # if it's called for subdir of a project it can't find funcs usages. All text editor integrations |
| 87 | + # with golangci-lint call it on a directory with the changed file. |
| 88 | + check-exported: false |
| 89 | + unparam: |
| 90 | + # call graph construction algorithm (cha, rta). In general, use cha for libraries, |
| 91 | + # and rta for programs with main packages. Default is cha. |
| 92 | + algo: cha |
| 93 | + |
| 94 | + # Inspect exported functions, default is false. Set to true if no external program/library imports your code. |
| 95 | + # XXX: if you enable this setting, unparam will report a lot of false-positives in text editors: |
| 96 | + # if it's called for subdir of a project it can't find external interfaces. All text editor integrations |
| 97 | + # with golangci-lint call it on a directory with the changed file. |
| 98 | + check-exported: false |
| 99 | + gocritic: |
| 100 | + disabled-checks: |
| 101 | + - ifElseChain |
| 102 | + - singleCaseSwitch |
| 103 | + - appendAssign |
| 104 | + |
| 105 | +issues: |
| 106 | + # List of regexps of issue texts to exclude, empty list by default. |
| 107 | + # But independently from this option we use default exclude patterns, |
| 108 | + # it can be disabled by `exclude-use-default: false`. To list all |
| 109 | + # excluded by default patterns execute `golangci-lint run --help` |
| 110 | + exclude: |
| 111 | + - composite literal uses unkeyed fields |
| 112 | + |
| 113 | + exclude-rules: |
| 114 | + # Exclude some linters from running on test files. |
| 115 | + - path: _test\.go$|^tests/|^samples/ |
| 116 | + linters: |
| 117 | + - errcheck |
| 118 | + - maligned |
| 119 | + |
| 120 | + # Independently from option `exclude` we use default exclude patterns, |
| 121 | + # it can be disabled by this option. To list all |
| 122 | + # excluded by default patterns execute `golangci-lint run --help`. |
| 123 | + # Default value for this option is true. |
| 124 | + exclude-use-default: true |
| 125 | + |
| 126 | + # Maximum issues count per one linter. Set to 0 to disable. Default is 50. |
| 127 | + max-per-linter: 0 |
| 128 | + |
| 129 | + # Maximum count of issues with the same text. Set to 0 to disable. Default is 3. |
| 130 | + max-same-issues: 0 |
0 commit comments