-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat(format): add --format-always
flag
#162
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Jamy Timmermans <[email protected]>
Do you mean that you have codes without import block so that you can not disable |
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. |
@JamyDev please update README then we can make it land. |
Signed-off-by: Jamy Timmermans <[email protected]>
updated! |
Signed-off-by: Jamy Timmermans <[email protected]>
Signed-off-by: Jamy Timmermans <[email protected]>
@JamyDev seems still conflict :( |
Fixed @daixiang0 |
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.