Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(golangci-lint): allow-parallel-runners #147

Merged
merged 1 commit into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ customConfig: # custom config for specific orgs or repos
qbox: # github organization name
golangci-lint:
enable: true
args: ["run", "-D", "staticcheck"] # disable staticcheck globally since we have a separate linter for it
args: ["run", "-D", "staticcheck", "--allow-parallel-runners=true","--timeout=5m0s"]

qbox/net-cache:
luacheck:
Expand All @@ -20,11 +20,11 @@ customConfig: # custom config for specific orgs or repos
qbox/net-cache:
golangci-lint:
enable: true
args: ["run", "--enable-all","-D", "staticcheck", "--timeout","5m0s"] # disable staticcheck globally since we have a separate linter for it
args: ["run", "--enable-all","-D", "staticcheck", "--timeout=5m0s", "--allow-parallel-runners=true"] # disable staticcheck globally since we have a separate linter for it
qbox/net-gslb:
golangci-lint:
enable: true
args: ["run", "--enable-all","-D", "staticcheck","--timeout","5m0s"] # disable staticcheck globally since we have a separate linter for it
args: ["run", "--enable-all","-D", "staticcheck","--timeout=5m0s", "--allow-parallel-runners=true"] # disable staticcheck globally since we have a separate linter for it

qbox/kodo:
staticcheck:
Expand Down
12 changes: 6 additions & 6 deletions docs/website/docs/components/go/golangci-lint.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ title: golangci-lint
sidebar_position: 1
---

[golangci-lint](https://github.com/golangci/golangci-lint) 是go语言领域非常优秀的linters执行器,她内置支持了很多go领域linter工具
[golangci-lint](https://github.com/golangci/golangci-lint) 是 go 语言领域非常优秀的 linters 执行器,她内置支持了很多 go 领域 linter 工具

**Reviewbot** 也使用 **golangci-lint** 来规范go代码的编写
**Reviewbot** 也使用 **golangci-lint** 来规范 go 代码的编写

默认情况下, **Reviewbot** 使用以下命令来检查go代码:
默认情况下, **Reviewbot** 使用以下命令来检查 go 代码:

```bash
golangci-lint run -D staticcheck
golangci-lint run -D staticcheck --timeout=5m0s --allow-parallel-runners=true
```

:::info
考虑到充分利用golangci-lint的特性,我们计划开启更多的linters
考虑到充分利用 golangci-lint 的特性,我们计划开启更多的 linters
详情参见: https://github.com/qiniu/reviewbot/issues/116
:::
:::
3 changes: 2 additions & 1 deletion internal/linters/go/golangci_lint/golangci_lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ func init() {

func golangciLintHandler(log *xlog.Logger, a linters.Agent) error {
if linters.IsEmpty(a.LinterConfig.Args...) {
a.LinterConfig.Args = append([]string{}, "run")
// refer: https://github.com/qiniu/reviewbot/issues/146
a.LinterConfig.Args = append([]string{}, "run", "--timeout=5m0s", "--allow-parallel-runners=true")
}

return linters.GeneralHandler(log, a, golangciLintParse)
Expand Down
Loading