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

feat:support CLI mode #514

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

feat:support CLI mode #514

wants to merge 2 commits into from

Conversation

wwcchh0123
Copy link
Contributor

@wwcchh0123 wwcchh0123 commented Dec 16, 2024

output:

image

Copy link

netlify bot commented Dec 16, 2024

Deploy Preview for reviewbot-x canceled.

Name Link
🔨 Latest commit 72476c7
🔍 Latest deploy log https://app.netlify.com/sites/reviewbot-x/deploys/67628f097d1ccc0008645884

@@ -52,7 +53,7 @@ import (
_ "github.com/qiniu/reviewbot/internal/linters/shell/shellcheck"
Copy link

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 辅助生成,如有疑问欢迎反馈交流

Copy link

codecov bot commented Dec 17, 2024

Codecov Report

Attention: Patch coverage is 11.11111% with 152 lines in your changes missing coverage. Please review.

Project coverage is 22.30%. Comparing base (8b1ee2d) to head (72476c7).
Report is 7 commits behind head on master.

Files with missing lines Patch % Lines
main.go 0.00% 40 Missing ⚠️
server.go 0.00% 40 Missing ⚠️
config/config.go 0.00% 18 Missing ⚠️
internal/util/util.go 48.27% 11 Missing and 4 partials ⚠️
internal/linters/shell/shellcheck/shellcheck.go 0.00% 10 Missing ⚠️
internal/lint/lint.go 0.00% 7 Missing ⚠️
internal/linters/doc/note-check/note.go 0.00% 7 Missing ⚠️
internal/linters/git-flow/commit/commit.go 0.00% 4 Missing ⚠️
internal/linters/go/gomodcheck/gomodcheck.go 62.50% 2 Missing and 1 partial ⚠️
internal/linters/java/pmdcheck/pmdcheck.go 0.00% 3 Missing ⚠️
... and 2 more
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.
📢 Have feedback on the report? Share it here.

@@ -108,14 +107,10 @@ func TestGoModCheck(t *testing.T) {

for _, tc := range tcs {
t.Run(tc.id, func(t *testing.T) {
Copy link

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 mainimport "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) {
Copy link

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 辅助生成,如有疑问欢迎反馈交流

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant