-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Use gofumpt instead of gofmt #4623
Conversation
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.
I love gofumpt
and there is no need to convince me (I use it since v0.1.0
) 😉
PS. I see that there is still some formatting missing, but the CI anyway will make sure that you will fix it.
Codecov Report
@@ Coverage Diff @@
## main #4623 +/- ##
=====================================
Coverage 81.3% 81.3%
=====================================
Files 222 222
Lines 17683 17682 -1
=====================================
+ Hits 14390 14391 +1
+ Misses 2993 2991 -2
Partials 300 300
|
gofumpt
is a stricter version ofgofmt
.Notably:
No empty lines following an assignment operator
No empty lines around function bodies
Functions should separate
) {
where the indentation helps readabilityNo empty lines around a lone statement (or comment) in a block
No empty lines before a simple error check
Composite literals should use newlines consistently
Empty field lists should use a single line
std
imports must be in a separate group at the topShort case clauses should take a single line
Multiline top-level declarations must be separated by empty lines
Single var declarations should not be grouped with parentheses
Contiguous top-level declarations should be grouped together
Simple var-declaration statements should use short assignments
The
-s
code simplification flag is enabled by defaultOctal integer literals should use the
0o
prefix on modules using Go 1.13 and laterComments which aren't Go directives should start with a whitespace
Composite literals should not have leading or trailing empty lines
Field lists should not have leading or trailing empty lines