qiniu / reviewbot

Comprehensive linters runner for code review scenarios
https://reviewbot-x.netlify.app
Apache License 2.0
13 stars 15 forks source link

golangci-lint linter: automatically infer the execution directory #207

Open CarlJi opened 4 days ago

CarlJi commented 4 days ago

background:

😱🚀 Linter: golangci-lint 
Repo: goplus/builder 
PR:   https://github.com/goplus/builder/pull/615 
Event: d4605c30-3469-11ef-83a5-c58febdb5641 
Unexpected: level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies"

In some monorepos, Go code is not placed in the main directory, and the current golangci-lint cannot automatically discover it. Reviewbot currently supports custom workDir, but it would be better if it could be automatically determined.

CarlJi commented 3 days ago

FYI: https://github.com/golangci/golangci-lint/issues/825