You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, all linters except `unused` can be merged into this meta linter.
134
140
The `unused` isn't merged because it has high memory usage.
135
141
136
-
Linters execution starts in `runAnalyzers`. It's the most complex part of the `golangci-lint`.
137
-
We use custom [go/analysis](https://pkg.go.dev/golang.org/x/tools/go/analysis) runner there. It runs as much as it can in parallel. It lazy-loads as much as it can
138
-
to reduce memory usage. Also, it sets all heavyweight data to `nil` as becomes unneeded to save memory.
142
+
Linters execution starts in `runAnalyzers`.
143
+
It's the most complex part of the `golangci-lint`.
144
+
We use custom [go/analysis](https://pkg.go.dev/golang.org/x/tools/go/analysis) runner there.
145
+
It runs as much as it can in parallel. It lazy-loads as much as it can to reduce memory usage.
146
+
Also, it sets all heavyweight data to `nil` as becomes unneeded to save memory.
139
147
140
148
We don't use existing [multichecker](https://pkg.go.dev/golang.org/x/tools/go/analysis/multichecker) because
141
149
it doesn't use caching and doesn't have some important performance optimizations.
Copy file name to clipboardExpand all lines: docs/src/docs/contributing/new-linters.mdx
+2-2
Original file line number
Diff line number
Diff line change
@@ -28,8 +28,8 @@ After that:
28
28
Look at other linters in this directory.
29
29
Implement linter integration and check that test passes.
30
30
3. Add the new struct for the linter (which you've implemented in `pkg/golinters/{yourlintername}.go`) to the
31
-
list of all supported linters in [`pkg/lint/lintersdb/manager.go`](https://github.com/golangci/golangci-lint/blob/master/pkg/lint/lintersdb/manager.go)
32
-
to the function `GetAllSupportedLinterConfigs`.
31
+
list of all supported linters in [`pkg/lint/lintersdb/builder_linter.go`](https://github.com/golangci/golangci-lint/blob/master/pkg/lint/lintersdb/builder_linter.go)
32
+
to the method `LinterBuilder.Build`.
33
33
- Add `WithSince("next_version")`, where `next_version` must be replaced by the next minor version. (ex: v1.2.0 if the current version is v1.1.0)
34
34
4. Find out what options do you need to configure for the linter.
35
35
For example, `nakedret` has only 1 option: [`max-func-lines`](https://github.com/golangci/golangci-lint/blob/master/.golangci.reference.yml).
0 commit comments