Skip to content

Commit

Permalink
feat: new golanngci-lint
Browse files Browse the repository at this point in the history
  • Loading branch information
wangcheng committed Feb 26, 2024
1 parent 32d4bcd commit f6137f2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions internal/linters/go/golangci_lint/golangci_lint.go
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)
}

0 comments on commit f6137f2

Please sign in to comment.