Skip to content

Conversation

@kyu08
Copy link
Contributor

@kyu08 kyu08 commented Aug 10, 2025

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?).

$ 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.

Please check if the PR fulfills these requirements

  • Cheatsheets are up-to-date (run go generate ./...)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • If a new UserConfig entry was added, make sure it can be hot-reloaded (see here)
  • Docs have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@kyu08 kyu08 changed the title Specify target packages for formatting in make format Pass only Git-tracked Go files to gofumpt Aug 10, 2025
@kyu08 kyu08 marked this pull request as ready for review August 10, 2025 09:51
@stefanhaller stefanhaller added the maintenance For refactorings, CI changes, tests, version bumping, etc label Aug 11, 2025
Copy link
Collaborator

@stefanhaller stefanhaller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fine to me (didn't test it though). I don't personally care very much, because I never format files manually; I rely on VS Code to do it automatically on save.

CONTRIBUTING.md Outdated

```
go install mvdan.cc/gofumpt@latest && gofumpt -l -w .
go install mvdan.cc/gofumpt@latest && make format
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure it's a good idea to change this; make format only works on Linux and Mac, but not on Windows (at least not out of the box).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the feed back!

make format only works on Linux and Mac, but not on Windows (at least not out of the box).

I didn't know that.
How about adding a comment like this?

+ # If you are using an environment without make, see the format target in `Makefile`.
go install mvdan.cc/gofumpt@latest && make format

Anyways I want to change this line because I think it's better that no one gets the error shown in the PR body to avoid unnecessary frustration.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To really "fix" it properly, we could add a script to the scripts folder, call it from the Makefile, and add a call to the script here in the readme.

I'm just not sure if it's worth it. We'd rather encourage people to configure their IDE to format on save, that's so much more convenient.

Copy link
Contributor Author

@kyu08 kyu08 Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just not sure if it's worth it. We'd rather encourage people to configure their IDE to format on save, that's so much more convenient.

That's true. (and actually I'm configuring so as well.)

I fixed not to use make target. e779d9b
If you prefer gofumpt -l -w ., I'll fix so.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to drop this change completely, I don't want so much noise in the document, and I don't find it important enough.

Also, once we switch to go 1.25 there will be an exclude mechanism that we can use to improve this, which will make your ls-files hack obsolete too; see golang/go#42965 (comment).

Copy link
Contributor Author

@kyu08 kyu08 Aug 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I decided to drop this change completely, I don't want so much noise in the document, and I don't find it important enough.

Thanks for the update for this PR.
I have no objections.

Also, once we switch to go 1.25 there will be an exclude mechanism that we can use to improve this, which will make your ls-files hack obsolete too; see golang/go#42965 (comment).

Thanks for the input. I didn't know that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried 1.25's ignore directive.
Unfortunately it does not work as expected.

 2025-08-15 at 0 01 29

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no surprise, gofumpt still needs to be updated to support it too. (See mvdan/gofumpt#250 (comment))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had misunderstood. Thank you for telling me. 🙇

@stefanhaller stefanhaller merged commit 28ef4a1 into jesseduffield:master Aug 12, 2025
13 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Sep 9, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [jesseduffield/lazygit](https://github.com/jesseduffield/lazygit) | minor | `v0.54.2` -> `v0.55.0` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>jesseduffield/lazygit (jesseduffield/lazygit)</summary>

### [`v0.55.0`](https://github.com/jesseduffield/lazygit/releases/tag/v0.55.0)

[Compare Source](jesseduffield/lazygit@v0.54.2...v0.55.0)

<!-- Release notes generated using configuration in .github/release.yml at v0.55.0 -->

#### What's Changed

##### Enhancements 🔥

- Allow filtering the keybindings menu by keybinding by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4821](jesseduffield/lazygit#4821)
- Add support for suspending LazyGit with Ctrl+Z on Unix systems by [@&#8203;cowboy8625](https://github.com/cowboy8625) in [#&#8203;4757](jesseduffield/lazygit#4757)
- Add "CopyToClipboard" command to `ConfirmationController` by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4810](jesseduffield/lazygit#4810)
- Add a user config for using git's external diff command for paging by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4832](jesseduffield/lazygit#4832)
- Log the hash of dropped stashes by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4850](jesseduffield/lazygit#4850)

##### Fixes 🔧

- Fix right-alignment of divergence from base branch for branch checked out in a worktree by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4824](jesseduffield/lazygit#4824)
- Support Azure DevOps vs-ssh.visualstudio.com SSH remotes as hosting provider by [@&#8203;Kahitar](https://github.com/Kahitar) in [#&#8203;4822](jesseduffield/lazygit#4822)
- Improve display of "esc" keybinding in the keybindings status bar by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4819](jesseduffield/lazygit#4819)
- Use external diff command in stashes panel by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4836](jesseduffield/lazygit#4836)
- Remove the git.paging.useConfig option by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4837](jesseduffield/lazygit#4837)
- Don't auto-forward branches that are checked out in another worktree by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4833](jesseduffield/lazygit#4833)
- Fix dropping range selection of filtered stashes by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4849](jesseduffield/lazygit#4849)
- Fix rare crash in interactive rebase (merge command without comment) by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4872](jesseduffield/lazygit#4872)
- Make it possible to rebind the Confirm keybinding by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4860](jesseduffield/lazygit#4860)

##### Maintenance ⚙️

- Pass only Git-tracked Go files to gofumpt by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4809](jesseduffield/lazygit#4809)
- Update donation wording so that it's clear there's no strings attached by [@&#8203;jesseduffield](https://github.com/jesseduffield) in [#&#8203;4827](jesseduffield/lazygit#4827)
- Enhance MR/Issue templates readability by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4829](jesseduffield/lazygit#4829)
- Run label check workflow only on label events and open pr event by [@&#8203;kyu08](https://github.com/kyu08) in [#&#8203;4830](jesseduffield/lazygit#4830)

##### Docs 📖

- Add installation with gah by [@&#8203;marverix](https://github.com/marverix) in [#&#8203;4820](jesseduffield/lazygit#4820)
- docs(VISION): fix "Dicoverability" typo by [@&#8203;Rudxain](https://github.com/Rudxain) in [#&#8203;4866](jesseduffield/lazygit#4866)
- Add dev container feature as installation method to README by [@&#8203;HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) in [#&#8203;4876](jesseduffield/lazygit#4876)

##### I18n 🌎

- Update translations from Crowdin by [@&#8203;stefanhaller](https://github.com/stefanhaller) in [#&#8203;4873](jesseduffield/lazygit#4873)

#### New Contributors

- [@&#8203;marverix](https://github.com/marverix) made their first contribution in [#&#8203;4820](jesseduffield/lazygit#4820)
- [@&#8203;Kahitar](https://github.com/Kahitar) made their first contribution in [#&#8203;4822](jesseduffield/lazygit#4822)
- [@&#8203;cowboy8625](https://github.com/cowboy8625) made their first contribution in [#&#8203;4757](jesseduffield/lazygit#4757)
- [@&#8203;Rudxain](https://github.com/Rudxain) made their first contribution in [#&#8203;4866](jesseduffield/lazygit#4866)
- [@&#8203;HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) made their first contribution in [#&#8203;4876](jesseduffield/lazygit#4876)

**Full Changelog**: <jesseduffield/lazygit@v0.54.2...v0.55.0>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45Ny40IiwidXBkYXRlZEluVmVyIjoiNDEuOTcuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
@kyu08 kyu08 mentioned this pull request Sep 20, 2025
7 tasks
kyu08 added a commit to kyu08/lazygit that referenced this pull request Sep 22, 2025
We have adopted the workaround passing a result of `git ls-files '*.go'
':!vendor'` to gofumpt in jesseduffield#4809. Currently, gofumpt suports `ignore`
directive. So we can use it without any workarounds.
kyu08 added a commit to kyu08/lazygit that referenced this pull request Sep 22, 2025
We have adopted the workaround passing a result of `git ls-files '*.go'
':!vendor'` to gofumpt in jesseduffield#4809. Currently, gofumpt suports `ignore`
directive. So we can use it without any workarounds.
kyu08 added a commit to kyu08/lazygit that referenced this pull request Oct 5, 2025
We have adopted the workaround passing a result of `git ls-files '*.go'
':!vendor'` to gofumpt in jesseduffield#4809. Currently, gofumpt suports `ignore`
directive. So we can use it without any workarounds.
kyu08 added a commit to kyu08/lazygit that referenced this pull request Oct 10, 2025
We have adopted the workaround passing a result of `git ls-files '*.go'
':!vendor'` to gofumpt in jesseduffield#4809. Currently, gofumpt suports `ignore`
directive. So we can use it without any workarounds.
kyu08 added a commit to kyu08/lazygit that referenced this pull request Oct 19, 2025
We have adopted the workaround passing a result of `git ls-files '*.go'
':!vendor'` to gofumpt in jesseduffield#4809. Currently, gofumpt suports `ignore`
directive. So we can use it without any workarounds.
stefanhaller added a commit that referenced this pull request Oct 20, 2025
…#4936)

### Motivation
To replace the workaround introduced in
#4809 with `ignore`
directive to make the code simpler.

### Overview
This is a follow-up PR to
#4809.
I have added 4 changes due to updating gofumpt to remove `git ls-files`
workaround.

Please take a look at each commit messages for details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintenance For refactorings, CI changes, tests, version bumping, etc

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants