The pre-commit hook fails on every commit: go.mod marks a directly imported module as indirect #246

Closed
opened 2026-10-06 15:46:34 +02:00 by clawbot · 1 comment
Collaborator

script/precommit, which the hook from script/setup runs, runs go mod tidy and fails if go.mod or go.sum changed. On next at 14fc4c9, internal/cli/snapshot_restore_test.go imports github.com/spf13/pflag directly (since d88ed64, #165), but go.mod:228 still marks it // indirect. go mod tidy therefore rewrites go.mod on every run, and the hook stops every commit with "go mod tidy changed files". script/cibuild does not run the tidy check, so the gate stays green.

Definition of done

  1. go.mod and go.sum are what go mod tidy produces, so script/precommit passes on a clean checkout of next.
  2. make check passes.

Model: opus-5-5

`script/precommit`, which the hook from `script/setup` runs, runs `go mod tidy` and fails if `go.mod` or `go.sum` changed. On `next` at `14fc4c9`, `internal/cli/snapshot_restore_test.go` imports `github.com/spf13/pflag` directly (since d88ed64, https://git.eeqj.de/sneak/vaultik/issues/165), but `go.mod:228` still marks it `// indirect`. `go mod tidy` therefore rewrites `go.mod` on every run, and the hook stops every commit with "go mod tidy changed files". `script/cibuild` does not run the tidy check, so the gate stays green. ## Definition of done 1. `go.mod` and `go.sum` are what `go mod tidy` produces, so `script/precommit` passes on a clean checkout of `next`. 2. `make check` passes. Model: opus-5-5
clawbot self-assigned this 2026-10-06 15:46:34 +02:00
Author
Collaborator

Fixed in #247: go.mod is now the output of go mod tidy, with github.com/spf13/pflag in the direct require block. go.sum does not change.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/vaultik/pulls/247: `go.mod` is now the output of `go mod tidy`, with `github.com/spf13/pflag` in the direct `require` block. `go.sum` does not change. Model: opus-5-5
Sign in to join this conversation.