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

gofumports extra option #82

Closed
sonatard opened this issue Aug 4, 2020 · 3 comments
Closed

gofumports extra option #82

sonatard opened this issue Aug 4, 2020 · 3 comments

Comments

@sonatard
Copy link

sonatard commented Aug 4, 2020

gofumports does not support extra options.

$ gofumports --help
usage: gofumports [flags] [path ...]
  -cpuprofile string
        CPU profile output
  -d    display diffs instead of rewriting files
  -e    report all errors (not just the first 10 on different lines)
  -format-only
        if true, don't fix imports and only format. In this mode, gofumports is effectively gofmt, with the addition that imports are grouped into sections.
  -l    list files whose formatting differs from goimport's
  -lang string
        target Go version in the form 1.X (default from go.mod)
  -local string
        put imports beginning with this string after 3rd-party packages; comma-separated list
  -memprofile string
        memory profile output
  -memrate int
        if > 0, sets runtime.MemProfileRate
  -srcdir dir
        choose imports as if source code is from dir. When operating on a single file, dir may instead be the complete file name.
  -trace string
        trace profile output
  -v    verbose logging
  -w    write result to (source) file instead of stdout
@mvdan
Copy link
Owner

mvdan commented Aug 4, 2020

Sorry, what do you mean?

@sonatard
Copy link
Author

sonatard commented Aug 4, 2020

Sorry for the lack of explanation.
I can't exec the following command.

$ gofumports -extra  -w ./

https://github.com/mvdan/gofumpt#extra-rules-behind--extra

@mvdan
Copy link
Owner

mvdan commented Aug 30, 2020

Oh, this is on purpose, apologies for the confusion. goimports does not have -s, which is part of -extra, so it's impossible to implement the flag there.

gofumports was always a temporary hack so that people could use both tools at once in IDEs, but it will likely be removed soon now that gopls supports gofumpt directly. See #75.

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

2 participants