Skip to content

Commit 417d0ba

Browse files
committed
docs: add new-from-merge-base inside FAQ
1 parent dee54a4 commit 417d0ba

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/src/docs/welcome/faq.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,20 @@ Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/iss
7676

7777
We are sure that every project can easily integrate `golangci-lint`, even the large one.
7878

79-
The idea is to not fix all existing issues. Fix only newly added issue: issues in new code.
80-
To do this setup CI to run `golangci-lint` with option `--new-from-rev=HEAD~1`.
79+
The idea is to not fix all existing issues.
80+
Fix only newly added issue: issues in new code.
8181

82-
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.
83-
In that regard `--new-from-rev=HEAD~1` is safer.
82+
To do this setup CI to run `golangci-lint` with options `--new-from-merge-base=main` or `--new-from-rev=HEAD~1`.
83+
84+
Also, take a look at option `--new`,
85+
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.
86+
In that regard `--new-from-merge-base=main` or `--new-from-rev=HEAD~1` are safer.
8487

8588
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
8689

87-
## Why `--new-from-rev` or `--new-from-patch` don't seem to be working in some cases?
90+
## Why `--new-from-xxx` don't seem to be working in some cases?
8891

89-
The options `--new-from-rev` and `--new-from-patch` work by comparing `git diff` output and issues.
92+
The options `--new-from-merge-base`, `--new-from-rev`, and `--new-from-patch` work by comparing `git diff` output and issues.
9093

9194
If an issue is not reported as the same line as the changes then the issue will be skipped.
9295
This is the line of the issue is not inside the lines changed.

0 commit comments

Comments
 (0)