Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v1.64.6 (forgejo) (#7118)

Co-authored-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
Co-committed-by: Renovate Bot <forgejo-renovate-action@forgejo.org>
This commit is contained in:
Renovate Bot 2025-03-04 21:38:35 +00:00 committed by forgejo-renovate-action
parent bb0e26a7b4
commit 6b436955fc
97 changed files with 258 additions and 345 deletions

View file

@ -4,7 +4,6 @@
package git
import (
"context"
"testing"
"github.com/stretchr/testify/assert"
@ -12,13 +11,13 @@ import (
)
func TestRunWithContextStd(t *testing.T) {
cmd := NewCommand(context.Background(), "--version")
cmd := NewCommand(t.Context(), "--version")
stdout, stderr, err := cmd.RunStdString(&RunOpts{})
require.NoError(t, err)
assert.Empty(t, stderr)
assert.Contains(t, stdout, "git version")
cmd = NewCommand(context.Background(), "--no-such-arg")
cmd = NewCommand(t.Context(), "--no-such-arg")
stdout, stderr, err = cmd.RunStdString(&RunOpts{})
if assert.Error(t, err) {
assert.Equal(t, stderr, err.Stderr())
@ -27,16 +26,16 @@ func TestRunWithContextStd(t *testing.T) {
assert.Empty(t, stdout)
}
cmd = NewCommand(context.Background())
cmd = NewCommand(t.Context())
cmd.AddDynamicArguments("-test")
require.ErrorIs(t, cmd.Run(&RunOpts{}), ErrBrokenCommand)
cmd = NewCommand(context.Background())
cmd = NewCommand(t.Context())
cmd.AddDynamicArguments("--test")
require.ErrorIs(t, cmd.Run(&RunOpts{}), ErrBrokenCommand)
subCmd := "version"
cmd = NewCommand(context.Background()).AddDynamicArguments(subCmd) // for test purpose only, the sub-command should never be dynamic for production
cmd = NewCommand(t.Context()).AddDynamicArguments(subCmd) // for test purpose only, the sub-command should never be dynamic for production
stdout, stderr, err = cmd.RunStdString(&RunOpts{})
require.NoError(t, err)
assert.Empty(t, stderr)
@ -55,15 +54,15 @@ func TestGitArgument(t *testing.T) {
}
func TestCommandString(t *testing.T) {
cmd := NewCommandContextNoGlobals(context.Background(), "a", "-m msg", "it's a test", `say "hello"`)
cmd := NewCommandContextNoGlobals(t.Context(), "a", "-m msg", "it's a test", `say "hello"`)
assert.EqualValues(t, cmd.prog+` a "-m msg" "it's a test" "say \"hello\""`, cmd.String())
cmd = NewCommandContextNoGlobals(context.Background(), "url: https://a:b@c/")
cmd = NewCommandContextNoGlobals(t.Context(), "url: https://a:b@c/")
assert.EqualValues(t, cmd.prog+` "url: https://sanitized-credential@c/"`, cmd.toString(true))
}
func TestGrepOnlyFunction(t *testing.T) {
cmd := NewCommand(context.Background(), "anything-but-grep")
cmd := NewCommand(t.Context(), "anything-but-grep")
assert.Panics(t, func() {
cmd.AddGitGrepExpression("whatever")
})