Comments (2)
gci formats only imports, and is great at that. gofumpt does a lot of other things gci doesn't and is great at them, but its import formatting is much more limited than gci's. Therefore as it stands, it makes perfect sense to me to want to use both of the tools.
Now, if gofumpt would grow some more abilities in the import sorting/grouping area, I certainly wouldn't mind. gofumpt might do a lot of the following already, but for my taste, the ability to do three groups with one empty line between each, and each group sorted internally alphabetically, would be fine: 1) stdlib, 2) 3rd party (everything that's not stdlib or "local", 3) "local". Alias, dot, and default imports I don't have a particular opinion about as long as they're sorted consistently within their respective group. Maybe all at the beginning or at the end of the group, also sorted by the module path. For the definition of "local", see https://github.com/daixiang0/gci#gci and https://github.com/daixiang0/gci#localmodule
The above is just my preference though (even if I believe it is a fairly common one).
from gofumpt.
gci and gofumpt overlap quite a lot in terms of wanting to be in control of how imports are grouped. They seem to have different goals as well. Why would you use both at the same time?
I don't plan on adding options to disable some of gofumpt's features. Just like gofmt, the tool becomes less useful the more options it gains, as it loses consistency.
If there is something in particular about import grouping that you think gci does better than gofumpt, I'm happy to consider it as a feature request. Or if gci makes any reasonable change that gofumpt later undoes, I'm also open to looking into that as a potential bug. Aside from those two options, I don't see the point in ensuring that gofumpt can be used together with gci.
from gofumpt.
Related Issues (20)
- panic while handling some //line directives HOT 2
- Breaks import comment HOT 1
- feature: Enforce line breaks between multiline function calls with func() argument HOT 1
- add simplifications for Go 1.22 HOT 1
- panic: invalid semver string: "v1.22rc2" HOT 1
- Making every added formatting rule Optional HOT 3
- missing binary release at latest version-v0.6.0 HOT 1
- Single import should not be grouped with parentheses
- Generated file not ignored HOT 2
- prevent indentation confusion
- Gofumpt removing newlines before comments HOT 7
- gofumpt is very slow when `go` is behind an asdf shim HOT 3
- Split long lines only available behind environment string
- Publish v1 HOT 2
- how to ignore certain folders? HOT 8
- Alias imported package to match the package name
- Group adjacent short variable declarations HOT 1
- Import grouping vs internal HOT 5
- octal notation with people misusing date.Time HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gofumpt.