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/welcome/faq.mdx
+9-6Lines changed: 9 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -76,17 +76,20 @@ Or you can create a [GitHub Issue](https://github.com/golangci/golangci-lint/iss
76
76
77
77
We are sure that every project can easily integrate `golangci-lint`, even the large one.
78
78
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.
81
81
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.
84
87
85
88
By doing this you won't create new issues in your code and can choose fix existing issues (or not).
86
89
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?
88
91
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.
90
93
91
94
If an issue is not reported as the same line as the changes then the issue will be skipped.
92
95
This is the line of the issue is not inside the lines changed.
0 commit comments