-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
format with gofumpt #18184
format with gofumpt #18184
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.
Just a lot of off-topic not related things.
token := "" | ||
session := emptyTestSession(t) | ||
if len(userDoer) != 0 { | ||
session = loginUser(t, userDoer) |
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.
token := "" | |
session := emptyTestSession(t) | |
if len(userDoer) != 0 { | |
session = loginUser(t, userDoer) | |
session := emptyTestSession(t) | |
if len(userDoer) != 0 { | |
var token string | |
session = loginUser(t, userDoer) |
@@ -18,7 +18,7 @@ func TestGitSmartHTTP(t *testing.T) { | |||
} | |||
|
|||
func testGitSmartHTTP(t *testing.T, u *url.URL) { | |||
var kases = []struct { | |||
kases := []struct { |
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.
Typo 😄
@@ -16,7 +16,7 @@ import ( | |||
|
|||
func TestGenAPILinks(t *testing.T) { | |||
setting.AppURL = "http://localhost:3000/" | |||
var kases = map[string][]string{ | |||
kases := map[string][]string{ |
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.
Typo
@@ -11,7 +11,7 @@ import ( | |||
) | |||
|
|||
func TestGetRefURL(t *testing.T) { | |||
var kases = []struct { | |||
kases := []struct { |
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.
Again... typo
@@ -76,7 +76,7 @@ func (mw *MuxWriter) SetFd(fd *os.File) { | |||
func NewFileLogger() LoggerProvider { | |||
log := &FileLogger{ | |||
Filename: "", | |||
Maxsize: 1 << 28, //256 MB | |||
Maxsize: 1 << 28, // 256 MB |
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.
Just off-topic, but now I see this anyway 1 << 28 is 268MB. Maybe 256e6
should be used, which is 256MB.
@@ -11,7 +11,7 @@ import ( | |||
) | |||
|
|||
func TestParseAcceptEncoding(t *testing.T) { | |||
var kases = []struct { | |||
kases := []struct { |
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 will personally send a new c
key,
@Gusted I already have one off-topic in this pull - I like to have your suggestions in an extra pull - this diff is already huge!!! |
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.
Voila
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.
gofumpt really does a good job
ps: @Gusted IMO the |
Ah I see, thanks! It was so confusing to see it being used. |
One more thing, this PR could replace an old PR |
I'll merge once we have an release branch |
I prefer to get it merged in 1.16. Reasons:
|
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.
you need to update:
make fmt
make fmt-check
We need gofumpt to be autodownloaded too.
And we probably also need to update the Dev documentation to explain you need gofumpt in vscode goland with explanations on how to enable that.
Conflicts come again .... I was thinking about we should get this merged as early as possible in 1.16 ..... Conflicts are dangerous, a lot of bugs are caused by conflicts. |
Agreed - but we need the above makefile things to be fixed. Now fortunately I think just rerunning gofumpt on the code will make them go away. (That of course will not necessarily work for conflicts that merging this PR will cause with other PRs.) |
* giteaoffical/main: [skip ci] Updated translations via Crowdin Refactor jwt.StandardClaims to RegisteredClaims (go-gitea#18344) format with gofumpt (go-gitea#18184) Enable deprecation error for v1.17.0 (go-gitea#18341) Use correct translation key for errors (go-gitea#18342) Refactor Router Logger (go-gitea#17308) Updated Chroma to v0.10.0 (go-gitea#18270)
I think we still need It can group the imports. The output o f gofumpt could be: import (
"os"
"path"
"code.gitea.io/gitea/modules/log" // gofumpt doesn't group imports
"code.gitea.io/gitea/modules/httpcache"
"code.gitea.io/gitea/modules/setting"
) Our import (
"os"
"path"
"code.gitea.io/gitea/modules/httpcache"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/setting"
) |
I think so. |
ok will do a follow up just for the |
-> #18526 |
* gofumpt -w -l . * gofumpt -w -l -extra . * Add linter * manual fix * change make fmt
as title