Skip to content

Commit e9d2167

Browse files
committed
docs: reorganize FAQ
1 parent 38fb349 commit e9d2167

File tree

1 file changed

+35
-35
lines changed

1 file changed

+35
-35
lines changed

docs/src/docs/usage/faq.mdx

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,55 +2,22 @@
22
title: FAQ
33
---
44

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
286

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)
328

339
## How to use `golangci-lint` in CI
3410

3511
Run `golangci-lint` in CI and check the exit code. If it's non-zero - fail the build.
3612

3713
See [how to properly install `golangci-lint` in CI](/usage/install#ci-installation)
3814

39-
## Which Go versions are supported
40-
41-
The same as the Go team (the 2 last minor versions)
42-
4315
## `golangci-lint` doesn't work
4416

4517
1. Please, ensure you are using the latest binary release.
4618
2. Run it with `-v` option and check the output.
4719
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.
4820

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-
5421
## Why do you have `typecheck` errors?
5522

5623
`typecheck` is like a front-end for the Go compiler errors.
@@ -77,3 +44,36 @@ How to troubleshoot:
7744
- [ ] Ensure building works with `go run ./...`/`go build ./...` - whole package.
7845
- [ ] Ensure you are not running an analysis on code that depends on files/packages outside the scope of the analyzed elements.
7946
- [ ] 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

Comments
 (0)