Skip to content

Conversation

kyu08
Copy link
Contributor

@kyu08 kyu08 commented Oct 5, 2025

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.

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 added 4 commits October 5, 2025 17:54
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.
After [v0.9.0](https://github.com/mvdan/gofumpt/releases/tag/v0.9.0),
gofumpt prohibits "naked return" for the sake of clarity. This makes
more readable when "named return value" is used.
For more infomation for "prohibition of naked return":
mvdan/gofumpt#285.
By running [email protected], the return value of `makeAtomic` function is
specified. After that, golangci-lint shows an error like `return copies
lock value: sync/atomic.Int32 contains sync/atomic.noCopy`.

This happens because atomic values should not be copied.
So I made a change using them as pointers.
gofumpt version for local developement is updated to `v0.9.1`.
This commit updates golangci-lint to `v2.5.0` which is the lastest and
the first version supports `[email protected]` to match the behavior of
local dev and ci.
This version of golangci-lint supports go 1.24 as well.
in, err := os.Open(src)
if err != nil {
return //nolint: nakedret
return err
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This commit does not change actual behavior of this functions because err is returned originally because this function uses "named return value".

@kyu08 kyu08 marked this pull request as ready for review October 5, 2025 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant