Skip to content
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

Use "goimports" or "gofmt" rather than "ptimports" for "format" task #269

Closed
nmiyake opened this issue Dec 13, 2017 · 1 comment
Closed
Labels

Comments

@nmiyake
Copy link
Contributor

nmiyake commented Dec 13, 2017

Currently, the format task runs gofmt and ptimports. The latter was a tool developed when godeps was still common and we wanted better import sorting.

With the vendor paradigm now being part of official/standard Go, there isn't much of a need to optimize godeps imports. Besides that, ptimports does the following:

  • Always converts imports to block form
  • Performs goimports spacing and also adds another block where project imports are placed

Although these are nice, I'm not sure that the marginal utility provided by these actions outweighs the benefits of using formatting that is more standard in the Go community. If gödel used gofmt or goimports by default, there would be far more repositories on which adding gödel and running the format task would not immediately modify most files.

Now that a plugin architecture exists, if a project really wants to run ptimports, they can add it as a plugin and do so. I think that also makes a strong case for switching the default format task to something more standard.

@nmiyake
Copy link
Contributor Author

nmiyake commented Apr 5, 2018

Fixed in 2.0.

@nmiyake nmiyake closed this as completed Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant