项目缺少代码格式化工具约定 #82
longyue0521
started this conversation in
General
Replies: 2 comments 6 replies
-
好建议!目前我们有一个 make setup 的命令,不过只是简单的运行 golint。这个命令的设计初衷,就是用来初始化开发环境的。 目前来看,我觉得我们先加一个 gofmt 进去。同时提供一个 make fmt 命令,这样后续用户永远只需要自己手动运行一下 make fmt,或者在 pre-push 的时候强制触发一下。 gofmt 或者 goimports,gofumpt 都可以。 但是我只有一个要求,如果工具不能调整的格式,就不能要求贡献者手动调整。手动调整格式一个性价比很低的事情。 关于 gofmt 还是 gofumpt,以及 goimports,我并没有特别强烈的偏好。如果你愿意,你可以在这里继续讨论这三者的差异,以及你最终觉得应该选择哪个。 |
Beta Was this translation helpful? Give feedback.
4 replies
-
commit-message 是否也需要统一标准呢?
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
问题描述:
当我为项目添加代码并保存时,我发现有很多“修改”都是代码格式化导致的,这在代码审查时会是干扰.
改进意见:
Beta Was this translation helpful? Give feedback.
All reactions