Skip to content

Commit 83d1f01

Browse files
committed
Pass only Git-tracked Go files to gofumpt
1 parent 77a9207 commit 83d1f01

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ by setting [`formatting.gofumpt`](https://github.com/golang/tools/blob/master/go
109109
To run gofumpt from your terminal go:
110110

111111
```
112-
go install mvdan.cc/gofumpt@latest && gofumpt -l -w .
112+
go install mvdan.cc/gofumpt@latest && make format
113113
```
114114

115115
## Programming Font

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,11 @@ test: unit-test integration-test-all
3434
generate:
3535
go generate ./...
3636

37+
# If you execute `gofumpt -l -w .`, it will format all Go files in the current directory, including `test/_results/*` files.
38+
# We pass only Git-tracked Go files to gofumpt because we don't want to format the test results or get errors from it.
3739
.PHONY: format
3840
format:
39-
gofumpt -l -w .
41+
git ls-files '*.go' ':!vendor' | xargs gofumpt -l -w
4042

4143
.PHONY: lint
4244
lint:

0 commit comments

Comments
 (0)