-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
ci(gci/import): improve golangci.yml and add gci linter #4010
Conversation
1. Added `gci.yml` for GCI, a tool to control Go package import order and ensure determinism. 2. Improved `golangci.yml` by adding the `goimports` linter. 3. Optimized some import statements in the code.
如果我本地想要检测怎么做呢,直接make lint吗,还是说一定要安装gci这个包? |
What if I want to detect it locally? Should I directly make lint, or do I have to install the gci package? |
如果安装了 下面命令是按照规则直接修改代码:
按照 自定义的排序顺序,忽略生成的代码以及 |
If The following commands directly modify the code according to the rules:
According to the custom sort order, ignoring the generated code and |
个人觉得标准库的优先级,应该最高,以及 gci write --custom-order \
--skip-generated \
--skip-vendor \
-s standard \
-s blank \
-s default \
-s dot \
-s "prefix(github.com/gogf/gf)" \
-s localmodule \
./ |
Personally, I think the standard library should have the highest priority, and gci write --custom-order \
--skip-generated \
--skip-vendor \
-s standard \
-s blank \
-s default \
-s dot \
-s "prefix(github.com/gogf/gf)" \
-s localmodule \
./ |
gci write --custom-order \
--skip-generated \
--skip-vendor \
-s standard \
-s blank \
-s default \
-s dot \
-s "prefix(github.com/gogf/gf/v2)" \
-s "prefix(github.com/gogf/gf/cmd)" \
-s "prefix(github.com/gogf/gf/contrib)" \
-s "prefix(github.com/gogf/gf/example)" \
./ 目前建议这样使用,来修复出现的提示 |
gci write --custom-order \
--skip-generated \
--skip-vendor \
-s standard \
-s blank \
-s default \
-s dot \
-s "prefix(github.com/gogf/gf/v2)" \
-s "prefix(github.com/gogf/gf/cmd)" \
-s "prefix(github.com/gogf/gf/contrib)" \
-s "prefix(github.com/gogf/gf/example)" \
./ It is currently recommended to use this method to fix the prompts that appear. |
ci: add gci.yml and improve golangci.yml
gci.yml
for GCI, a tool to control Go package import order and ensure determinism.golangci.yml
by adding thegoimports
linter.