-
-
Couldn't load subscription status.
- Fork 2.3k
Pass only Git-tracked Go files to gofumpt #4809
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
Conversation
make formatThere was a problem hiding this 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 |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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 formatAnyways 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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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))
There was a problem hiding this comment.
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. 🙇
e779d9b to
e9cc07d
Compare
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 [@​stefanhaller](https://github.com/stefanhaller) in [#​4821](jesseduffield/lazygit#4821) - Add support for suspending LazyGit with Ctrl+Z on Unix systems by [@​cowboy8625](https://github.com/cowboy8625) in [#​4757](jesseduffield/lazygit#4757) - Add "CopyToClipboard" command to `ConfirmationController` by [@​kyu08](https://github.com/kyu08) in [#​4810](jesseduffield/lazygit#4810) - Add a user config for using git's external diff command for paging by [@​stefanhaller](https://github.com/stefanhaller) in [#​4832](jesseduffield/lazygit#4832) - Log the hash of dropped stashes by [@​stefanhaller](https://github.com/stefanhaller) in [#​4850](jesseduffield/lazygit#4850) ##### Fixes 🔧 - Fix right-alignment of divergence from base branch for branch checked out in a worktree by [@​stefanhaller](https://github.com/stefanhaller) in [#​4824](jesseduffield/lazygit#4824) - Support Azure DevOps vs-ssh.visualstudio.com SSH remotes as hosting provider by [@​Kahitar](https://github.com/Kahitar) in [#​4822](jesseduffield/lazygit#4822) - Improve display of "esc" keybinding in the keybindings status bar by [@​stefanhaller](https://github.com/stefanhaller) in [#​4819](jesseduffield/lazygit#4819) - Use external diff command in stashes panel by [@​stefanhaller](https://github.com/stefanhaller) in [#​4836](jesseduffield/lazygit#4836) - Remove the git.paging.useConfig option by [@​stefanhaller](https://github.com/stefanhaller) in [#​4837](jesseduffield/lazygit#4837) - Don't auto-forward branches that are checked out in another worktree by [@​stefanhaller](https://github.com/stefanhaller) in [#​4833](jesseduffield/lazygit#4833) - Fix dropping range selection of filtered stashes by [@​stefanhaller](https://github.com/stefanhaller) in [#​4849](jesseduffield/lazygit#4849) - Fix rare crash in interactive rebase (merge command without comment) by [@​stefanhaller](https://github.com/stefanhaller) in [#​4872](jesseduffield/lazygit#4872) - Make it possible to rebind the Confirm keybinding by [@​stefanhaller](https://github.com/stefanhaller) in [#​4860](jesseduffield/lazygit#4860) ##### Maintenance ⚙️ - Pass only Git-tracked Go files to gofumpt by [@​kyu08](https://github.com/kyu08) in [#​4809](jesseduffield/lazygit#4809) - Update donation wording so that it's clear there's no strings attached by [@​jesseduffield](https://github.com/jesseduffield) in [#​4827](jesseduffield/lazygit#4827) - Enhance MR/Issue templates readability by [@​kyu08](https://github.com/kyu08) in [#​4829](jesseduffield/lazygit#4829) - Run label check workflow only on label events and open pr event by [@​kyu08](https://github.com/kyu08) in [#​4830](jesseduffield/lazygit#4830) ##### Docs 📖 - Add installation with gah by [@​marverix](https://github.com/marverix) in [#​4820](jesseduffield/lazygit#4820) - docs(VISION): fix "Dicoverability" typo by [@​Rudxain](https://github.com/Rudxain) in [#​4866](jesseduffield/lazygit#4866) - Add dev container feature as installation method to README by [@​HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) in [#​4876](jesseduffield/lazygit#4876) ##### I18n 🌎 - Update translations from Crowdin by [@​stefanhaller](https://github.com/stefanhaller) in [#​4873](jesseduffield/lazygit#4873) #### New Contributors - [@​marverix](https://github.com/marverix) made their first contribution in [#​4820](jesseduffield/lazygit#4820) - [@​Kahitar](https://github.com/Kahitar) made their first contribution in [#​4822](jesseduffield/lazygit#4822) - [@​cowboy8625](https://github.com/cowboy8625) made their first contribution in [#​4757](jesseduffield/lazygit#4757) - [@​Rudxain](https://github.com/Rudxain) made their first contribution in [#​4866](jesseduffield/lazygit#4866) - [@​HenningLorenzen-ext-bayer](https://github.com/HenningLorenzen-ext-bayer) made their first contribution in [#​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-->
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.
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.
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.
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.
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.
…#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.

PR Description
The below error message is shown when executing
make formatwhentest/_results/demo/worktree_create_from_branches/actual/repo/src/shims.goexists (maybe executing integration test produces this file?).I have confirmed it works without above error when I run
make formaton this PR's branch.Please check if the PR fulfills these requirements
Cheatsheets are up-to-date (rungo 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