-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wangcheng
committed
Feb 26, 2024
1 parent
32d4bcd
commit f6137f2
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package golangci_lint | ||
|
||
import ( | ||
"github.com/qiniu/reviewbot/internal/linters" | ||
"github.com/qiniu/x/xlog" | ||
) | ||
|
||
var lintName = "golangci-lint" | ||
|
||
func init() { | ||
linters.RegisterPullRequestHandler(lintName, golangciLintHandler) | ||
} | ||
|
||
func golangciLintHandler(log *xlog.Logger, a linters.Agent) error { | ||
if linters.IsEmpty(a.LinterConfig.Args...) { | ||
// turn off compile errors by default | ||
a.LinterConfig.Args = append([]string{}, "run") | ||
} | ||
|
||
return linters.GeneralHandler(log, a, linters.GeneralParse) | ||
} |