Git Product home page Git Product logo

Comments (2)

scop avatar scop commented on August 26, 2024 1

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.

mvdan avatar mvdan commented on August 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.