Skip to content

Commit

Permalink
README: document UI changes when compared to gofmt
Browse files Browse the repository at this point in the history
We've accumulated a few special behaviors since the last release.
Document them. Especially the special diagnostic comment.
  • Loading branch information
mvdan committed Nov 7, 2021
1 parent bdfa3b0 commit ac6653b
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ replacement. Running `gofmt` after `gofumpt` should be a no-op. For example:

gofumpt -l -w .

Most of the Go source files in this repository belong to the Go project.
Some of the Go source files in this repository belong to the Go project.
The added formatting rules are in the `format` package.

Beyond the [added rules below](#Added-rules), the tool differs from gofmt in the
following ways:

* Vendor directories are skipped unless given as explicit arguments
* The added rules are not applied to generated Go files
* The `-r` rewrite feature is removed in favor of `gofmt -r`

### Added rules

No empty lines following an assignment operator
Expand Down Expand Up @@ -583,6 +590,21 @@ before sending a pull request.
We also use the `#gofumpt` channel over at the
[Gophers Slack](https://invite.slack.golangbridge.org/) to chat.

When reporting a formatting bug, insert a `//gofumpt:diagnose` comment.
The comment will be rewritten to include useful debugging information.
For instance:

```
$ cat f.go
package p
//gofumpt:diagnose
$ gofumpt f.go
package p
//gofumpt:diagnose v0.1.1-0.20211103104632-bdfa3b02e50a -lang=v1.16
```

### License

Note that much of the code is copied from Go's `gofmt` command. You can tell
Expand Down

0 comments on commit ac6653b

Please sign in to comment.