|
1 | 1 | --- |
2 | | -# golangci.com configuration |
3 | | -# https://github.com/golangci/golangci/wiki/Configuration |
4 | | - |
5 | | -run: |
6 | | - timeout: 5m |
7 | | - |
8 | | -linters-settings: |
9 | | - dupl: |
10 | | - threshold: 100 |
11 | | - funlen: |
12 | | - lines: 100 |
13 | | - statements: 80 |
14 | | - goconst: |
15 | | - min-len: 2 |
16 | | - min-occurrences: 2 |
17 | | - gocritic: |
18 | | - enabled-tags: |
19 | | - - diagnostic |
20 | | - - experimental |
21 | | - - opinionated |
22 | | - - performance |
23 | | - - style |
24 | | - disabled-checks: |
25 | | - - dupImport # https://github.com/go-critic/go-critic/issues/845 |
26 | | - - ifElseChain |
27 | | - - octalLiteral |
28 | | - - whyNoLint |
29 | | - - wrapperFunc |
30 | | - gocyclo: |
31 | | - min-complexity: 18 |
32 | | - goimports: |
33 | | - local-prefixes: github.com/golangci/golangci-lint |
34 | | - govet: |
35 | | - settings: |
36 | | - printf: |
37 | | - funcs: |
38 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Infof |
39 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Warnf |
40 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Errorf |
41 | | - - (github.com/golangci/golangci-lint/pkg/logutils.Log).Fatalf |
42 | | - misspell: |
43 | | - locale: US |
44 | | - nolintlint: |
45 | | - allow-unused: false # report any unused nolint directives |
46 | | - require-explanation: false # don't require an explanation for nolint directives |
47 | | - require-specific: false # don't require nolint directives to be specific about which linter is being skipped |
| 2 | +# Configuration |
| 3 | +# https://golangci-lint.run/usage/configuration/ |
| 4 | + |
| 5 | +version: "2" |
48 | 6 |
|
49 | 7 | linters: |
50 | | - # please, do not use `enable-all`: it's deprecated and will be removed soon. |
51 | | - # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint |
52 | | - disable-all: true |
53 | | - enable: |
54 | | - - asciicheck |
55 | | - - bodyclose |
56 | | - - copyloopvar |
57 | | - - dogsled |
| 8 | + # https://golangci-lint.run/usage/configuration/#linters-configuration |
| 9 | + default: all |
| 10 | + |
| 11 | + # explicitly disabled linters |
| 12 | + disable: |
| 13 | + - containedctx |
| 14 | + - contextcheck |
| 15 | + - cyclop |
| 16 | + - depguard |
58 | 17 | - errcheck |
59 | | - - errname |
| 18 | + - exhaustruct |
60 | 19 | - exhaustive |
61 | | - - funlen |
62 | | - - gochecknoinits |
63 | | - - goconst |
64 | | - - gocritic |
65 | | - - gocyclo |
66 | | - - godot |
67 | | - - gosimple |
68 | | - - err113 |
| 20 | + - forbidigo |
| 21 | + - gochecknoglobals # no configuration options |
| 22 | + - nilnil |
| 23 | + - nlreturn # redundant with wsl |
| 24 | + - paralleltest |
| 25 | + - revive |
| 26 | + - tagalign |
| 27 | + - thelper |
| 28 | + - varnamelen |
| 29 | + - wrapcheck |
| 30 | + |
| 31 | + exclusions: |
| 32 | + generated: lax |
| 33 | + |
| 34 | + rules: |
| 35 | + - path: pkg/app/tests/ |
| 36 | + linters: |
| 37 | + - dupl |
| 38 | + - forbidigo |
| 39 | + - wsl |
| 40 | + |
| 41 | + - path: internal/pkg/xdg/ |
| 42 | + linters: |
| 43 | + - gochecknoinits |
| 44 | + - gosec |
| 45 | + - mnd |
| 46 | + - testableexamples |
| 47 | + - testifylint |
| 48 | + - usetesting |
| 49 | + - wsl |
| 50 | + |
| 51 | + - path: pkg/cc/signals/ |
| 52 | + linters: |
| 53 | + - mnd |
| 54 | + |
| 55 | + - path: pkg/cli/cmd/ |
| 56 | + linters: |
| 57 | + - dupl |
| 58 | + |
| 59 | + - path: pkg/cli/editor/ |
| 60 | + linters: |
| 61 | + - dupword |
| 62 | + - errcheck |
| 63 | + - errorlint |
| 64 | + - forcetypeassert |
| 65 | + - gocritic |
| 66 | + - godox |
| 67 | + - gosec |
| 68 | + - mnd |
| 69 | + - ireturn |
| 70 | + - lll |
| 71 | + - makezero |
| 72 | + - nonamedreturns |
| 73 | + - recvcheck |
| 74 | + - wsl |
| 75 | + |
| 76 | + - path: pkg/app/handlers/authorizer.go |
| 77 | + linters: |
| 78 | + - tagliatelle |
| 79 | + |
| 80 | + - path: pkg/app/handlers/config.go |
| 81 | + linters: |
| 82 | + - tagliatelle |
| 83 | + |
| 84 | + - path: cmd/topaz-db/ |
| 85 | + linters: |
| 86 | + - staticcheck |
| 87 | + |
| 88 | + - path: tests/ |
| 89 | + linters: |
| 90 | + - dupl |
| 91 | + |
| 92 | + settings: |
| 93 | + cyclop: |
| 94 | + max-complexity: 12 |
| 95 | + |
| 96 | + errcheck: |
| 97 | + exclude-functions: |
| 98 | + - fmt.Fprint |
| 99 | + - fmt.Fprintf |
| 100 | + - fmt.Fprintln |
| 101 | + - os.Close |
| 102 | + |
| 103 | + funlen: |
| 104 | + lines: 80 |
| 105 | + statements: 60 |
| 106 | + ignore-comments: true |
| 107 | + |
| 108 | + gomoddirectives: |
| 109 | + replace-allow-list: |
| 110 | + - github.com/slok/go-http-metrics |
| 111 | + |
| 112 | + gosec: |
| 113 | + excludes: |
| 114 | + - G104 # Errors unhandled |
| 115 | + - G304 # Potential file inclusion via variable (see https://github.com/golang/go/issues/67002) |
| 116 | + |
| 117 | + ireturn: |
| 118 | + allow: |
| 119 | + # stdlib |
| 120 | + - anon |
| 121 | + - error |
| 122 | + - empty |
| 123 | + - stdlib |
| 124 | + - generic |
| 125 | + - context.Context |
| 126 | + - http.Handler |
| 127 | + - io.Reader |
| 128 | + # 3rd-party |
| 129 | + - proto.Message |
| 130 | + - v1.AccessServer |
| 131 | + - v3.ModelServer |
| 132 | + - v3.ReaderServer |
| 133 | + - v3.WriterServer |
| 134 | + - v3.ExporterServer |
| 135 | + - v3.ImporterServer |
| 136 | + - datasync.SyncClient |
| 137 | + |
| 138 | + lll: |
| 139 | + line-length: 150 |
| 140 | + |
| 141 | + # recvcheck: |
| 142 | + # exclusions: |
| 143 | + # - "*.UnmarshalGQL" |
| 144 | + |
| 145 | + tagliatelle: |
| 146 | + case: |
| 147 | + rules: |
| 148 | + json: snake |
| 149 | + yaml: snake |
| 150 | + |
| 151 | +formatters: |
| 152 | + enable: |
69 | 153 | - gofmt |
| 154 | + - gofumpt |
70 | 155 | - goimports |
71 | | - - goprintffuncname |
72 | | - - gosec |
73 | | - - gosimple |
74 | | - - govet |
75 | | - - importas |
76 | | - - ineffassign |
77 | | - - misspell |
78 | | - - nakedret |
79 | | - - noctx |
80 | | - - rowserrcheck |
81 | | - - staticcheck |
82 | | - - stylecheck |
83 | | - - testifylint |
84 | | - - testpackage |
85 | | - - typecheck |
86 | | - - unconvert |
87 | | - - unparam |
88 | | - - unused |
89 | | - - wastedassign |
90 | | - |
91 | | - # don't enable: |
92 | | - # - depguard |
93 | | - # - dupl |
94 | | - # - gochecknoglobals |
95 | | - # - gocognit |
96 | | - # - godox |
97 | | - # - gomnd |
98 | | - # - lll |
99 | | - # - nestif |
100 | | - # - nolintlint # conflict with 1.19 gofmt changes |
101 | | - # - prealloc |
102 | | - # - revive |
103 | | - # - wsl |
104 | | - # - whitespace |
105 | | - |
106 | | -issues: |
107 | | - # List of regexps of issue texts to exclude, empty list by default. |
108 | | - # But independently from this option we use default exclude patterns, |
109 | | - # it can be disabled by `exclude-use-default: false`. To list all |
110 | | - # excluded by default patterns execute `golangci-lint run --help` |
111 | | - exclude: |
112 | | - - declaration of "(err|ctx)" shadows declaration at |
113 | | - - shadow of imported from 'github.com/stretchr/testify/assert' package 'assert' |
114 | | - # Excluding configuration per-path, per-linter, per-text and per-source |
115 | | - exclude-rules: |
116 | | - - path: _test\.go |
117 | | - linters: |
118 | | - - gomnd |
119 | | - # https://github.com/go-critic/go-critic/issues/926 |
120 | | - - text: "unnecessaryDefer:" |
121 | | - linters: |
122 | | - - gocritic |
123 | | - - text: "unnamedResult:" |
124 | | - linters: |
125 | | - - gocritic |
126 | | - - path: \.resolvers\.go |
127 | | - text: "typeDefFirst:" |
128 | | - linters: |
129 | | - - gocritic |
130 | | - - path: \.resolvers\.go |
131 | | - text: "paramTypeCombine:" |
132 | | - linters: |
133 | | - - gocritic |
134 | | - - path: \.resolvers\.go |
135 | | - text: "hugeParam:" |
136 | | - linters: |
137 | | - - gocritic |
138 | | - # integer overflow conversion |
139 | | - - text: "G115" |
140 | | - linters: |
141 | | - - gosec |
142 | | - - text: "G404" |
143 | | - linters: |
144 | | - - gosec |
145 | | - - text: "SA1019: \\S+ is deprecated" |
146 | | - linters: |
147 | | - - staticcheck |
|
0 commit comments