Coder Social home page Coder Social logo

Comments (3)

mvdan avatar mvdan commented on August 26, 2024

Correct, there isn't a gofumpt -r because you should use gofmt -r. There are three reasons for this:

  1. gofmt -r works, and gofumpt is not in the business of pattern rewrites.
  2. gofmt -r has always been quite limited by design; https://github.com/rsc/rf is their new attempt and it's far more powerful. I don't see a point in investing more time into gofmt -r, particularly since neither approach has anything to do with canonical formatting.
  3. It is a surprisingly complex chunk of code that we don't need to maintain on our end.

Also note that our README says:

It can be used as a drop-in replacement to format your Go code

I think that still holds true; at least in my head, rewrite rules have little to do with canonical formatting like gofmt or gofumpt.

In any case, I'm happy to get input on better ways to document both of these aspects :)

from gofumpt.

silverwind avatar silverwind commented on August 26, 2024

I guess in the end such "rewrites" are the job of a linter's autofix, e.g. ruff --fix or eslint --fix serve the purpose very will in those respective languages, but golang's linter's are rudimentary compared to those two, golangci's --fix is borderline useless.

I still hope a better go linter arises, golangci really pales in comparision to what other linters can do.

from gofumpt.

mvdan avatar mvdan commented on August 26, 2024

I'm going to close this then, as it seems like the misunderstanding is solved. Still happy to receive suggestions in terms of better wording - in that case please send a PR.

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.