|
1 | | -# golangci.com configuration |
2 | | -# https://github.com/golangci/golangci/wiki/Configuration |
3 | | - |
| 1 | +version: "2" |
4 | 2 | run: |
5 | 3 | build-tags: |
6 | 4 | - testtools |
7 | | - |
8 | | -linters-settings: |
9 | | - govet: |
10 | | - settings: |
11 | | - printf: |
12 | | - funcs: |
13 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
14 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
15 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
16 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
17 | | - gocyclo: |
18 | | - min-complexity: 12 |
19 | | - dupl: |
20 | | - threshold: 100 |
21 | | - goconst: |
22 | | - min-len: 2 |
23 | | - min-occurrences: 2 |
24 | | - misspell: |
25 | | - locale: US |
26 | | - lll: |
27 | | - line-length: 140 |
28 | | - goimports: |
29 | | - local-prefixes: github.com/golangci/golangci-lint |
30 | | - gocritic: |
31 | | - enabled-tags: |
32 | | - - performance |
33 | | - - style |
34 | | - - experimental |
35 | | - disabled-checks: |
36 | | - - wrapperFunc |
37 | | - gofumpt: |
38 | | - extra-rules: true |
39 | | - |
40 | 5 | linters: |
| 6 | + default: none |
41 | 7 | enable: |
42 | | - - errcheck |
43 | | - - gosimple |
44 | | - - govet |
45 | | - - gofmt |
46 | | - - gocyclo |
47 | | - - ineffassign |
48 | | - - stylecheck |
49 | | - - misspell |
50 | | - - staticcheck |
51 | | - - unused |
52 | | - - prealloc |
53 | | - - typecheck |
54 | | - # additional linters |
55 | 8 | - bodyclose |
56 | | - - gocritic |
57 | | - - err113 |
58 | | - - goimports |
59 | | - - revive |
60 | | - - misspell |
61 | | - - noctx |
62 | | - - stylecheck |
63 | | - - gosec |
64 | 9 | - contextcheck |
65 | 10 | - durationcheck |
| 11 | + - err113 |
| 12 | + - errcheck |
66 | 13 | - errchkjson |
67 | | -# - errorlint |
68 | 14 | - gochecksumtype |
| 15 | + - gocritic |
| 16 | + - gocyclo |
| 17 | + - gosec |
| 18 | + - govet |
| 19 | + - ineffassign |
| 20 | + - misspell |
69 | 21 | - nilerr |
| 22 | + - noctx |
| 23 | + - prealloc |
70 | 24 | - reassign |
| 25 | + - revive |
| 26 | + - staticcheck |
| 27 | + - unused |
71 | 28 | - whitespace |
72 | | - enable-all: false |
73 | | - disable-all: true |
74 | | - |
75 | | -issues: |
76 | | - exclude-files: |
77 | | - - "(.*/)*.*_test.go" |
78 | | - exclude-dirs: |
79 | | - - internal/fixtures |
80 | | - exclude-rules: |
81 | | - - linters: |
82 | | - - gosec |
83 | | - text: "weak cryptographic primitive" |
84 | | - |
85 | | - - linters: |
86 | | - - stylecheck |
87 | | - text: "ST1016" |
88 | | - exclude: |
89 | | - # Default excludes from `golangci-lint run --help` with EXC0002 removed |
90 | | - # EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok |
91 | | - - Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
92 | | - # EXC0002 golint: Annoying issue about not having a comment. The rare codebase has such comments |
93 | | - # - (comment on exported (method|function|type|const)|should have( a package)? comment|comment should be of the form) |
94 | | - # EXC0003 golint: False positive when tests are defined in package 'test' |
95 | | - - func name will be used as test\.Test.* by other packages, and that stutters; consider calling this |
96 | | - # EXC0004 govet: Common false positives |
97 | | - - (possible misuse of unsafe.Pointer|should have signature) |
98 | | - # EXC0005 staticcheck: Developers tend to write in C-style with an explicit 'break' in a 'switch', so it's ok to ignore |
99 | | - - ineffective break statement. Did you mean to break out of the outer loop |
100 | | - # EXC0006 gosec: Too many false-positives on 'unsafe' usage |
101 | | - - Use of unsafe calls should be audited |
102 | | - # EXC0007 gosec: Too many false-positives for parametrized shell calls |
103 | | - - Subprocess launch(ed with variable|ing should be audited) |
104 | | - # EXC0008 gosec: Duplicated errcheck checks |
105 | | - - (G104|G307) |
106 | | - # EXC0009 gosec: Too many issues in popular repos |
107 | | - - (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) |
108 | | - # EXC0010 gosec: False positive is triggered by 'src, err := ioutil.ReadFile(filename)' |
109 | | - - Potential file inclusion via variable |
| 29 | + settings: |
| 30 | + dupl: |
| 31 | + threshold: 100 |
| 32 | + goconst: |
| 33 | + min-len: 2 |
| 34 | + min-occurrences: 2 |
| 35 | + gocritic: |
| 36 | + disabled-checks: |
| 37 | + - wrapperFunc |
| 38 | + enabled-tags: |
| 39 | + - performance |
| 40 | + - style |
| 41 | + - experimental |
| 42 | + gocyclo: |
| 43 | + min-complexity: 12 |
| 44 | + govet: |
| 45 | + settings: |
| 46 | + printf: |
| 47 | + funcs: |
| 48 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
| 49 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
| 50 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
| 51 | + - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
| 52 | + lll: |
| 53 | + line-length: 140 |
| 54 | + misspell: |
| 55 | + locale: US |
| 56 | + exclusions: |
| 57 | + generated: lax |
| 58 | + presets: |
| 59 | + - comments |
| 60 | + - common-false-positives |
| 61 | + - legacy |
| 62 | + - std-error-handling |
| 63 | + rules: |
| 64 | + - linters: |
| 65 | + - gosec |
| 66 | + text: weak cryptographic primitive |
| 67 | + - linters: |
| 68 | + - staticcheck |
| 69 | + text: ST1016 |
| 70 | + - path: (.+)\.go$ |
| 71 | + text: Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*print(f|ln)?|os\.(Un)?Setenv). is not checked |
| 72 | + - path: (.+)\.go$ |
| 73 | + text: func name will be used as test\.Test.* by other packages, and that stutters; consider calling this |
| 74 | + - path: (.+)\.go$ |
| 75 | + text: (possible misuse of unsafe.Pointer|should have signature) |
| 76 | + - path: (.+)\.go$ |
| 77 | + text: ineffective break statement. Did you mean to break out of the outer loop |
| 78 | + - path: (.+)\.go$ |
| 79 | + text: Use of unsafe calls should be audited |
| 80 | + - path: (.+)\.go$ |
| 81 | + text: Subprocess launch(ed with variable|ing should be audited) |
| 82 | + - path: (.+)\.go$ |
| 83 | + text: (G104|G307) |
| 84 | + - path: (.+)\.go$ |
| 85 | + text: (Expect directory permissions to be 0750 or less|Expect file permissions to be 0600 or less) |
| 86 | + - path: (.+)\.go$ |
| 87 | + text: Potential file inclusion via variable |
| 88 | + paths: |
| 89 | + - (.*/)*.*_test.go |
| 90 | + - internal/fixtures |
| 91 | + - third_party$ |
| 92 | + - builtin$ |
| 93 | + - examples$ |
| 94 | +formatters: |
| 95 | + enable: |
| 96 | + - gofmt |
| 97 | + - goimports |
| 98 | + settings: |
| 99 | + gofumpt: |
| 100 | + extra-rules: true |
| 101 | + goimports: |
| 102 | + local-prefixes: |
| 103 | + - github.com/golangci/golangci-lint |
| 104 | + exclusions: |
| 105 | + generated: lax |
| 106 | + paths: |
| 107 | + - (.*/)*.*_test.go |
| 108 | + - internal/fixtures |
| 109 | + - third_party$ |
| 110 | + - builtin$ |
| 111 | + - examples$ |
0 commit comments