1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-08-24 19:39:16 +02:00

Pass only Git-tracked Go files to gofumpt (#4809)

## **PR Description**
The below error message is shown when executing `make format` when
`test/_results/demo/worktree_create_from_branches/actual/repo/src/shims.go`
exists (maybe executing integration test produces this file?).

```sh
$ make format
gofumpt -l -w .
test/_results/demo/worktree_create_from_branches/actual/repo/src/shims.go:1:20: expected 'package', found 'EOF'
make: *** [format] Error 2
```

I have confirmed it works without above error when I run `make format`
on this PR's branch.
This commit is contained in:
Stefan Haller
2025-08-12 11:46:02 +02:00
committed by GitHub

View File

@@ -34,9 +34,11 @@ test: unit-test integration-test-all
generate:
go generate ./...
# If you execute `gofumpt -l -w .`, it will format all Go files in the current directory, including `test/_results/*` files.
# We pass only Git-tracked Go files to gofumpt because we don't want to format the test results or get errors from it.
.PHONY: format
format:
gofumpt -l -w .
git ls-files '*.go' ':!vendor' | xargs gofumpt -l -w
.PHONY: lint
lint: