Skip to content

chore: Update golangci-lint from v2.1 to v2.2 #3668

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

Merged

Conversation

alexandear
Copy link
Member

@alexandear alexandear commented Jun 30, 2025

This PR updates golangci-lint to v2.2.1 and enables new revive checks.

macOS:

$ golangci-lint version
golangci-lint has version 2.2.1 built with go1.24.4 from 66496a9 on 2025-06-29T15:57:59Z
$ golangci-lint run
cmd/limactl/tunnel.go:121:3: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
                fmt.Fprintf(stdout, "Open <System Settings> → <Network> → <Wi-Fi> (or whatever) → <Details> → <Proxies> → <SOCKS proxy>,\n")
                ^
cmd/limactl/tunnel.go:122:3: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
                fmt.Fprintf(stdout, "and specify the following configuration:\n")
                ^
cmd/limactl/tunnel.go:123:3: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
                fmt.Fprintf(stdout, "- Server: 127.0.0.1\n")
                ^
cmd/limactl/tunnel.go:126:3: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
                fmt.Fprintf(stdout, "Open <Settings> → <Network & Internet> → <Proxy>,\n")
                ^
cmd/limactl/tunnel.go:127:3: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
                fmt.Fprintf(stdout, "and specify the following configuration:\n")
                ^
cmd/limactl/tunnel.go:128:3: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
                fmt.Fprintf(stdout, "- Address: socks=127.0.0.1\n")
                ^
pkg/hostagent/hostagent.go:226:15: unnecessary-format: unnecessary use of formatting function "fmt.Fprintf", you can replace it with "fmt.Fprint" (revive)
        if _, err := fmt.Fprintf(&b, `# This SSH config file can be passed to 'ssh -F'.
                     ^
pkg/networks/commands_test.go:52:4: unnecessary-format: unnecessary use of formatting function "t.Skipf", you can replace it with "t.Skip" (revive)
                        t.Skipf("socket_vmnet is not installed")
                        ^
pkg/networks/commands_test.go:83:4: unnecessary-format: unnecessary use of formatting function "t.Skipf", you can replace it with "t.Skip" (revive)
                        t.Skipf("socket_vmnet is not installed")
                        ^
pkg/portfwd/control_others.go:29:2: bare-return: avoid using bare returns, please add return expressions (revive)
        return
        ^
pkg/vz/network_darwin_test.go:84:2: unnecessary-format: unnecessary use of formatting function "t.Logf", you can replace it with "t.Log" (revive)
        t.Logf("Receiving and verifying data packets...")
        ^
11 issues:
* revive: 11

Linux:

$ golangci-lint run
pkg/guestagent/guestagent_linux.go:172:2: bare-return: avoid using bare returns, please add return expressions (revive)
  	return
  	^
pkg/guestagent/timesync/timesync_linux.go:24:3: bare-return: avoid using bare returns, please add return expressions (revive)
  		return
  		^
pkg/guestagent/timesync/timesync_linux.go:29:3: bare-return: avoid using bare returns, please add return expressions (revive)
  		return
  		^
  3 issues:
  * revive: 3

Windows:

$ golangci-lint run
pkg\portfwd\control_windows.go:22:2: bare-return: avoid using bare returns, please add return expressions (revive)
  	return
  	^
  1 issues:
  * revive: 1

@alexandear alexandear force-pushed the chore/update-golangci-lint branch from ea84488 to b8a2e84 Compare July 1, 2025 15:48
Signed-off-by: Oleksandr Redko <oleksandr.red+github@gmail.com>
@alexandear alexandear force-pushed the chore/update-golangci-lint branch from b8a2e84 to f915900 Compare July 1, 2025 15:59
@alexandear alexandear requested a review from a team July 1, 2025 16:03
@jandubois jandubois added this to the v1.1.2 milestone Jul 1, 2025
@jandubois jandubois merged commit 73c5f97 into lima-vm:master Jul 1, 2025
36 checks passed
@alexandear alexandear deleted the chore/update-golangci-lint branch July 1, 2025 19:17
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.

3 participants