-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
assets/formatters: update the GCI documentation #5891
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
assets/formatters: update the GCI documentation #5891
Conversation
The `gci` tool does not format code - it only ensures that import blocks are formatted deterministically, according to the configuration. The previous documentation blurb looks like it may have been copy-pasted from some of the other formatter docs, and was misleading at best. Signed-off-by: Steve Kuznetsov <stekuznetsov@microsoft.com>
Hey, thank you for opening your first Pull Request ! |
Sorry but gci format the code. |
@ldez this is simply not true. Please test it out yourself ... here's a commit where without |
@stevekuznetsov This is simply true, but you are thinking that There is
|
@ldez I am providing you exactly the steps to reproduce this .... why don't you try it instead of closing my issues? I have sent you the exact repo you can test it with and exactly the commands I am running. |
Why don't you read my previous comment? |
I am showing you the diff with |
Here is the full reproducer starting from a fresh clone.
|
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
In fact, the code should be formatted based on the |
Ok this is a type of "bug" of package main
import (
"fmt"
"os"
)
type Foo struct {
Value string
} The code is formatted only if the imports are updated by So I was right: |
Unless |
There are air-quotes because this is intentional from the POV of But obviously this is not expected from the POV of golangci-lint. |
The situation is an illustration of why it's better to open an issue before opening a PR. You have opened a PR that modifies a generated file, and said something false from my POV. If an issue had been opened, I think the situation would have been different. At the end, we found a bug, but the experience was not good for you and me. Sorry if you experienced this as rude, but your approach was not right either. The problem will be fixed, and in the future, I hope we will remember this story as a simple misunderstanding. |
Dismissive comment + immediately closing the issue doesn't just experience as rude, it is rude. Asking a simple question for clarification and keeping the issue open wouldn't hurt you one bit, would it? |
You are not happy, I heard it. I tried to de-escalate, but you don't want to. This ends the discussion. |
The
gci
tool does not format code - it only ensures that import blocks are formatted deterministically, according to the configuration. The previous documentation blurb looks like it may have been copy-pasted from some of the other formatter docs, and was misleading at best.