Skip to content

Commit 6603022

Browse files
committed
chore: Update tools
1 parent 4f65413 commit 6603022

3 files changed

Lines changed: 13 additions & 15 deletions

File tree

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ env:
1818
CHOCOLATEY_VERSION: 2.6.0 # https://github.com/chocolatey/choco/releases
1919
COSIGN_VERSION: 3.0.2 # https://github.com/sigstore/cosign/releases
2020
GO_VERSION: 1.25.5 # https://go.dev/doc/devel/release
21-
GOLANGCI_LINT_VERSION: 2.6.2 # https://github.com/golangci/golangci-lint/releases
21+
GOLANGCI_LINT_VERSION: 2.7.0 # https://github.com/golangci/golangci-lint/releases
2222
GORELEASER_VERSION: 2.13.0 # https://github.com/goreleaser/goreleaser/releases
2323
PYTHON_VERSION: '3.10' # https://www.python.org/downloads/
2424
RAGE_VERSION: 0.11.1 # https://github.com/str4d/rage/releases
2525
SYFT_VERSION: 1.38.0 # https://github.com/anchore/syft/releases
26-
UV_VERSION: 0.9.14 # https://github.com/astral-sh/uv/releases
26+
UV_VERSION: 0.9.15 # https://github.com/astral-sh/uv/releases
2727
jobs:
2828
changes:
2929
runs-on: ubuntu-22.04

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ linters:
145145
disabled: true
146146
- name: cyclomatic
147147
disabled: true
148+
- name: deep-exit
149+
disabled: true
148150
- name: empty-block
149151
disabled: true
150152
- name: enforce-switch-style

internal/cmd/main_test.go

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ var (
3838
envVarRx = regexp.MustCompile(`\$\w+`)
3939
umaskConditionRx = regexp.MustCompile(`\Aumask:([0-7]{3})\z`)
4040

41-
filterRegex string
41+
filterRegex = flag.String("filter", "", "regex to filter test scripts")
4242

4343
//go:embed mockcommand.tmpl
4444
mockcommandTmplText string
@@ -48,10 +48,6 @@ var (
4848
)
4949

5050
func TestMain(m *testing.M) {
51-
if strings.Contains(os.Args[0], "cmd.test") {
52-
flag.StringVar(&filterRegex, "filter", "", "regex to filter test scripts")
53-
flag.Parse()
54-
}
5551
testscript.Main(m, map[string]func(){
5652
"chezmoi": func() {
5753
//nolint:revive
@@ -73,10 +69,10 @@ func TestScript(t *testing.T) {
7369
if err != nil {
7470
t.Fatalf("failed to glob files: %v", err)
7571
}
76-
if filterRegex != "" {
77-
re, err := regexp.Compile(filterRegex)
72+
if *filterRegex != "" {
73+
re, err := regexp.Compile(*filterRegex)
7874
if err != nil {
79-
t.Fatalf("invalid regex %q: %v", filterRegex, err)
75+
t.Fatalf("invalid regex %q: %v", *filterRegex, err)
8076
}
8177
var filteredFiles []string
8278
for _, f := range files {
@@ -87,7 +83,7 @@ func TestScript(t *testing.T) {
8783
}
8884
files = filteredFiles
8985
if len(files) == 0 {
90-
t.Fatalf("no test scripts match regex %q", filterRegex)
86+
t.Fatalf("no test scripts match regex %q", *filterRegex)
9187
}
9288
}
9389
testscript.Run(t, testscript.Params{
@@ -606,8 +602,8 @@ func cmdMockCommand(ts *testscript.TestScript, neg bool, args []string) {
606602
value := r.RequireEnv[key]
607603
fmt.Fprintf(&builder, " IF NOT \"%%%s%%\" == \"%s\" (\n", key, value)
608604
fmt.Fprintf(&builder, " echo.%s=%%%s%%, expected %s\n", key, key, value)
609-
fmt.Fprintf(&builder, " exit /b 1\n") //nolint:revive
610-
fmt.Fprintf(&builder, " )\n") //nolint:revive
605+
fmt.Fprint(&builder, " exit /b 1\n")
606+
fmt.Fprint(&builder, " )\n")
611607
}
612608
var redirect string
613609
if r.Destination == "stderr" {
@@ -636,8 +632,8 @@ func cmdMockCommand(ts *testscript.TestScript, neg bool, args []string) {
636632
value := r.RequireEnv[key]
637633
fmt.Fprintf(&builder, " if [ \"${%s}\" != \"%s\" ]; then\n", key, value)
638634
fmt.Fprintf(&builder, " echo \"%s=${%s}, expected %s\"\n", key, key, value)
639-
fmt.Fprintf(&builder, " exit 1\n") //nolint:revive
640-
fmt.Fprintf(&builder, " fi\n") //nolint:revive
635+
fmt.Fprint(&builder, " exit 1\n")
636+
fmt.Fprint(&builder, " fi\n")
641637
}
642638
var redirect string
643639
if r.Destination == "stderr" {

0 commit comments

Comments
 (0)