Comments (3)
Correct, there isn't a gofumpt -r
because you should use gofmt -r
. There are three reasons for this:
gofmt -r
works, and gofumpt is not in the business of pattern rewrites.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 intogofmt -r
, particularly since neither approach has anything to do with canonical formatting.- 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.
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.
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)
- install as a CLI HOT 2
- Remove empty lines in if and for similar to functions HOT 13
- Proposal: Clothe naked returns HOT 10
- 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
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.