10000 fix: formats consistently the code with gci by ldez · Pull Request #5893 · golangci/golangci-lint · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: formats consistently the code with gci #5893

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

Merged
merged 1 commit into from
Jun 23, 2025

Conversation

ldez
Copy link
Member
@ldez ldez commented Jun 23, 2025
This code will be formatted
package main

import (
	"fmt"

	"os"
)

type Foo struct {
Value string
}
This code will NOT be formatted
package main

type Foo struct {
Value string
}

The code is formatted only if the imports are updated by gci.

This is not consistent.

< 8000 /div>
@ldez ldez added this to the v2-unreleased milestone Jun 23, 2025
@ldez ldez added bug Something isn't working linter: update Update the linter implementation inside golangci-lint area: formatters/fmt labels Jun 23, 2025
@ldez ldez requested a review from bombsimon June 23, 2025 19:19
Copy link
Member
@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is the intended and expected behavior, should this be fixed in gci directly or is there a difference where formatters in golangci-lint has special behavior?

Copy link
Member
@bombsimon bombsimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, saw your opinion now in #5891 (comment)

@ldez ldez merged commit db7f62b into golangci:main Jun 23, 2025
18 checks passed
@ldez ldez deleted the fix/gci-inconsistency branch June 23, 2025 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: formatters/fmt bug Something isn't working linter: update Update the linter implementation inside golangci-lint
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0