-
Notifications
You must be signed in to change notification settings - Fork 15
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
feat:support CLI mode #514
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for reviewbot-x canceled.
|
@@ -52,7 +53,7 @@ import ( | |||
_ "github.com/qiniu/reviewbot/internal/linters/shell/shellcheck" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
File is not gci
-ed with --skip-generated -s standard -s default (gci)
Details
lint 解释
这个lint结果表明文件没有按照GCI(Go Code Import)工具的规范进行导入排序。GCI是一个用于自动整理Go代码导入语句的工具,以保持代码的一致性和可读性。
错误用法
以下是一个错误的示例,展示了未按GCI规范排列的导入语句:
package main
import (
"fmt"
"net/http"
"github.com/example/package1"
"github.com/example/package2"
)
在这个例子中,导入语句没有按照字母顺序排列。
正确用法
以下是一个正确的示例,展示了按GCI规范排列的导入语句:
package main
import (
"fmt"
"net/http"
"github.com/example/package1"
"github.com/example/package2"
)
在这个例子中,导入语句已经按照字母顺序排列。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #514 +/- ##
==========================================
- Coverage 22.91% 22.30% -0.61%
==========================================
Files 36 36
Lines 5080 5231 +151
==========================================
+ Hits 1164 1167 +3
- Misses 3776 3920 +144
- Partials 140 144 +4 ☔ View full report in Codecov by Sentry. |
@@ -108,14 +107,10 @@ func TestGoModCheck(t *testing.T) { | |||
|
|||
for _, tc := range tcs { | |||
t.Run(tc.id, func(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unnecessary leading newline (whitespace)
Details
lint 解释
这个lint结果表明代码中存在不必要的前导换行符(空白字符)。在Go语言中,通常不需要在文件的开头或函数、方法等的定义之前添加额外的空行。
错误用法
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
在这个例子中,在package main
和import "fmt"
之间有一个不必要的空行。
正确用法
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
在这个例子中,去掉了不必要的空行,代码更加简洁。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
@@ -489,3 +525,17 @@ func main() { | |||
//nolint:gocritic | |||
log.Fatal(http.ListenAndServe(fmt.Sprintf(":%d", o.port), mux)) | |||
} | |||
|
|||
func cliMode(o cliOptions) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
empty-lines: extra empty line at the end of a block (revive)
Details
lint 解释
这个lint结果表明在代码块的末尾存在多余的空行。根据编码规范,通常不建议在代码块的末尾添加额外的空行。
错误用法
func example() {
fmt.Println("Hello, World!")
}
在这个示例中,在fmt.Println("Hello, World!")
之后有一个多余的空行。
正确用法
func example() {
fmt.Println("Hello, World!")
}
在这个示例中,去掉了多余的空行,使得代码更加简洁和规范。
💡 以上内容由 AI 辅助生成,如有疑问欢迎反馈交流
output: