Skip to content

Conversation

@JamyDev
Copy link

@JamyDev JamyDev commented Jul 13, 2023

Add the option to always run goFormat.Source even if there are no imports.

Justification:

Currently we have to run 2 formatters to make sure everything is properly formatter (gofmt and gci). Yet any fime that has imports and gets formatted by gci, doesn't actually need to get ran through gofmt. This eliminates this double tool problem.

@daixiang0
Copy link
Owner

Do you mean that you have codes without import block so that you can not disable gofmt?

@JamyDev
Copy link
Author

JamyDev commented Jul 14, 2023

I have configured gci as the default formatter for my project. Which also means configuring it as the default format on save in my IDE. Right now, the formatting doesn't happen for files that don't have an import block, since gci just skips those. Adding this flag basically makes it fall back to gofmt fir any files without imports so the rest of the file is properly formatted.

@daixiang0
Copy link
Owner

@JamyDev please update README then we can make it land.

@JamyDev
Copy link
Author

JamyDev commented Jul 17, 2023

updated!

Signed-off-by: Jamy Timmermans <[email protected]>
Signed-off-by: Jamy Timmermans <[email protected]>
@daixiang0
Copy link
Owner

@JamyDev seems still conflict :(

@JamyDev
Copy link
Author

JamyDev commented Oct 31, 2023

Fixed @daixiang0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants