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

Hide some flags/features from gofmt #105

Closed
mvdan opened this issue Jan 5, 2021 · 0 comments
Closed

Hide some flags/features from gofmt #105

mvdan opened this issue Jan 5, 2021 · 0 comments

Comments

@mvdan
Copy link
Owner

mvdan commented Jan 5, 2021

We are backwards compatible with gofmt in terms of formatting, and in general we want to be a drop-in replacement.

However, some gofmt flags and features don't really belong in gofumpt. For example:

  • The rewrite flag, -r, isn't used by many people. Those who depend on it should just use gofmt -r.
  • The simplify flag, -s, is on by default in gofumpt. It makes little sense to allow disabling it. The only use case I can think of is the Go compiler itself, since it needs to bootstrap from a very old version of Go, which might break if -s removes some types which later Go versions made optional. But we could always fix that with the -lang flag.
  • The -cpuprofile flag is an internal performance tool, so it shouldn't really be exposed. The -e flag probably fits the same bill, but perhaps some users actually make use of it.
@mvdan mvdan added this to the v0.2.0 milestone Mar 11, 2021
@mvdan mvdan removed this from the v0.2.0 milestone May 20, 2021
mvdan added a commit that referenced this issue Oct 3, 2021
The rewrite flag isn't particularly advanced or powerful.
If some users want it, gofmt will continue to have it.

The simplify flag is on by default in gofumpt,
and we don't really intend the user to turn it off.
Remove the flag entirely, to avoid confusion.

Note that this means we can remove most of rewrite.go,
except the bits needed by simplify.go.

Fixes #105.
Updates #115.
@mvdan mvdan closed this as completed in 4d8e76d Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant