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
Copy file name to clipboardExpand all lines: docs/src/docs/usage/faq.mdx
+35-35Lines changed: 35 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,55 +2,22 @@
2
2
title: FAQ
3
3
---
4
4
5
-
## How do you add a custom linter?
6
-
7
-
You can integrate it yourself, see this [manual](/contributing/new-linters/).
8
-
Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
9
-
10
-
## How to integrate `golangci-lint` into large project with thousands of issues
11
-
12
-
We are sure that every project can easily integrate `golangci-lint`, even the large one.
13
-
14
-
The idea is to not fix all existing issues. Fix only newly added issue: issues in new code.
15
-
To do this setup CI to run `golangci-lint` with option `--new-from-rev=HEAD~1`.
16
-
17
-
Also, take a look at option `--new`, but consider that CI scripts that generate unstaged files will make `--new` only point out issues in those files and not in the last commit.
18
-
In that regard `--new-from-rev=HEAD~1` is safer.
19
-
20
-
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
21
-
22
-
## Why `--new-from-rev` or `--new-from-patch` don't seem to be working in some cases?
23
-
24
-
The options `--new-from-rev` and `--new-from-patch` work by comparing `git diff` output and issues.
25
-
26
-
If an issue is not reported as the same line as the changes then the issue will be skipped.
27
-
This is the line of the issue is not inside the lines changed.
5
+
## Which Go versions are supported
28
6
29
-
To fix that you have to use the option `--whole-files`.
30
-
31
-
The side effect is the issues inside file that contains changes but not directly related to the changes themselves will be reported.
7
+
The same as the Go team (the 2 latest minor versions)
32
8
33
9
## How to use `golangci-lint` in CI
34
10
35
11
Run `golangci-lint` in CI and check the exit code. If it's non-zero - fail the build.
36
12
37
13
See [how to properly install `golangci-lint` in CI](/usage/install#ci-installation)
38
14
39
-
## Which Go versions are supported
40
-
41
-
The same as the Go team (the 2 last minor versions)
42
-
43
15
## `golangci-lint` doesn't work
44
16
45
17
1. Please, ensure you are using the latest binary release.
46
18
2. Run it with `-v` option and check the output.
47
19
3. If it doesn't help create a [GitHub issue](https://github.com/golangci/golangci-lint/issues/new) with the output from the error and #2 above.
48
20
49
-
## Why running with `--fast` is slow on the first run
50
-
51
-
Because the first run caches type information. All subsequent runs will be fast.
52
-
Usually this options is used during development on local machine and compilation was already performed.
53
-
54
21
## Why do you have `typecheck` errors?
55
22
56
23
`typecheck` is like a front-end for the Go compiler errors.
@@ -77,3 +44,36 @@ How to troubleshoot:
77
44
-[ ] Ensure building works with `go run ./...`/`go build ./...` - whole package.
78
45
-[ ] Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements.
79
46
-[ ] If using CGO, ensure all require system libraries are installed.
47
+
48
+
## Why running with `--fast` is slow on the first run
49
+
50
+
Because the first run caches type information. All subsequent runs will be fast.
51
+
Usually this options is used during development on local machine and compilation was already performed.
52
+
53
+
## How do you add a custom linter?
54
+
55
+
You can integrate it yourself, see this [manual](/contributing/new-linters/).
56
+
Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/issues/new) and we will integrate when time permits.
57
+
58
+
## How to integrate `golangci-lint` into large project with thousands of issues
59
+
60
+
We are sure that every project can easily integrate `golangci-lint`, even the large one.
61
+
62
+
The idea is to not fix all existing issues. Fix only newly added issue: issues in new code.
63
+
To do this setup CI to run `golangci-lint` with option `--new-from-rev=HEAD~1`.
64
+
65
+
Also, take a look at option `--new`, but consider that CI scripts that generate unstaged files will make `--new` only point out issues in those files and not in the last commit.
66
+
In that regard `--new-from-rev=HEAD~1` is safer.
67
+
68
+
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
69
+
70
+
## Why `--new-from-rev` or `--new-from-patch` don't seem to be working in some cases?
71
+
72
+
The options `--new-from-rev` and `--new-from-patch` work by comparing `git diff` output and issues.
73
+
74
+
If an issue is not reported as the same line as the changes then the issue will be skipped.
75
+
This is the line of the issue is not inside the lines changed.
76
+
77
+
To fix that you have to use the option `--whole-files`.
78
+
79
+
The side effect is the issues inside file that contains changes but not directly related to the changes themselves will be reported.
0 commit comments