Skip to content

fix: Go 1.27 tooling — gofmt last in format target + golangci v2.13.1 + errcheck v1.20.0 - #10

Merged
bborbe merged 2 commits into
masterfrom
fix/go127
Aug 22, 2026
Merged

fix: Go 1.27 tooling — gofmt last in format target + golangci v2.13.1 + errcheck v1.20.0#10
bborbe merged 2 commits into
masterfrom
fix/go127

Conversation

@bborbe

Copy link
Copy Markdown
Owner

Reorder the canonical format target so gofmt runs last (after goimports-reviser + golines), matching the go-skeleton fix. Bump golangci-lint to v2.13.1 (Go 1.27 staticcheck buildir panic) and errcheck to v1.20.0 (Go 1.27 package-without-types). Verified: make precommit PASS on Go 1.27.

@ben-s-pull-request-reviewerben-s-pull-request-reviewerBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Step 4c-sel CLASSIFY — changed files: CHANGELOG.md, Makefile.precommit, tools.env

Checking which judgment rules have triggers matching these files:

RuleTriggerMatch?
changelog/conventional-prefix-requiredCHANGELOG.md✅ YES
changelog/preamble-frozen(script — not judgment)N/A
changelog/unreleased-entry-required(script — not judgment)N/A
go-licensing/copyright-year-discipline**/*.go❌ No Go files
go-licensing/license-file-required(script)N/A
go-licensing/source-file-header-required**/*.go❌ No Go files
go-licensing/readme-license-section-required(script)N/A
go-linting/* rules.golangci.yaml/.yml❌ Not changed
go-mod-* rulesgo.mod/go.sum❌ Not changed
git-* rules@commits❌ Not a commit
agent-cmd/*, go-architecture/*, etc.various .md/.go patterns❌ None match

Classification result:

  • Applicable (1):changelog/conventional-prefix-required
  • Skipped: all other judgment rules — triggers don't match the diff

Step 4d-sel ADJUDICATE

Reading the changelog rule block: the new bullet is - chore: Bump errcheck to v1.20.0 and golangci-lint to v2.13.1 for Go 1.27 support. The prefix chore: is in the allowed set (feat:, fix:, refactor:, test:, docs:, chore:, perf:). ✅ Compliant.

Checking the Makefile.precommit format target ordering:

  • Old: gofmt ran first, then goimports-reviser, then golines
  • New: goimports-reviser, then golines, then gofmt last
  • The comment explains: "gofmt last so its wrapping is normalized and the gofmt lint check passes" — this is correct behavior

Checking tools.env version bumps:

  • ERRCHECK_VERSION: v1.10.0 → v1.20.0
  • GOLANGCI_LINT_VERSION: v2.12.2 → v2.13.1
  • Both are patch/minor bumps for Go 1.27 compatibility — semver-consistent, no issues

No violations found. Mechanical funnel: 0 findings.


Selector Mode Traceability:

  • Candidates: 1 rule matched by Step 4b-i glob filter
  • Applicable: 1 rule (changelog/conventional-prefix-required)
  • Skipped: all other judgment rules — no trigger glob matched the changed files

Must Fix (Critical)

None.

Should Fix (Important)

None.

Nice to Have (Optional)

None.

Notes:

  • The format target reordering in Makefile.precommit is correct: gofmt must run after goimports-reviser and golines to normalize any wrapping changes made by the earlier formatters. The comment accurately describes this.
  • The version bumps in tools.env (errcheck v1.20.0, golangci-lint v2.13.1) are appropriate for Go 1.27 support.
  • The CHANGELOG bullet uses the correct chore: prefix with specific version numbers.

{
"verdict": "approve",
"summary": "PR updates tooling versions (errcheck v1.20.0, golangci-lint v2.13.1) for Go 1.27 compatibility and correctly reorders the format target so gofmt runs last after goimports-reviser and golines. CHANGELOG entry uses the proper 'chore:' prefix with specific version numbers. No violations found.",
"comments": [],
"concerns_addressed": [
"correctness: format target ordering verified — gofmt runs last after goimports-reviser and golines in Makefile.precommit",
"correctness: version bumps in tools.env are semver-compatible and Go 1.27-ready",
"correctness: gofmt command uses find -exec + syntax correctly",
"changelog: bullet uses correct 'chore:' prefix with version numbers"
]
}

@ben-s-pull-request-reviewer
ben-s-pull-request-reviewerBot dismissed their stale reviewAugust 22, 2026 09:32

superseded by new automated review

@ben-s-pull-request-reviewerben-s-pull-request-reviewerBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I now have everything I need. Let me analyze the findings:

Mechanical findings verification:

  1. no-bare-error-call on h.ServeHTTPFALSE POSITIVE. http.Handler.ServeHTTP(http.ResponseWriter, *http.Request) has signature func(http.ResponseWriter, *http.Request) — it returns no values. The ast-grep rule cannot determine this from the call site alone. Confirmed present at lines 63, 81, 96, 117, 139, 182, 195, 210, 222, 235, 248.

  2. no-bare-error-call on sender.SendCommandReturnsFALSE POSITIVE. SendCommandReturns is a test mock setter (Counterfeiter-generated) with signature func(...interface{}) — it too returns nothing. Confirmed at line 129.

  3. suite-test-file-requiredFALSE POSITIVE. pkg/handler/suite_test.go exists with a proper TestHandler → ginkgo.RunSpecs entry point. The ast-grep checker incorrectly flags the file being tested because it shares the same package handler_test.

  4. reflect.Ptr → reflect.PointerCORRECT FIX. Go 1.27 deprecated reflect.Ptr in favor of reflect.Pointer. The diff correctly changes if t.Kind() == reflect.Ptr to reflect.Pointer.

Diff review:

FileChangeAssessment
CHANGELOG.mdUnreleased entry for tool bumpsCorrect
Makefile.precommitgofmt moved after goimports-reviser and golines; comment addedCorrect — gofmt normalizes golines wrapping
tools.envERRCHECK_VERSION v1.10.0→v1.20.0, GOLANGCI_LINT_VERSION v2.12.2→v2.13.1Compatible with Go 1.27
trigger_handler_test.goreflect.Ptrreflect.Pointer (Go 1.27 compat)Correct
{
"verdict": "approve",
"summary": "PR is a clean tooling-only update. The `reflect.Ptr→reflect.Pointer` fix at trigger_handler_test.go:165 corrects a Go 1.27 deprecation. The Makefile.precommit reorders the format pipeline so gofmt runs after golines (correct). Version bumps for errcheck v1.20.0 and golangci-lint v2.13.1 are compatible with Go 1.27. All 13 ast-grep findings are false positives: http.Handler.ServeHTTP returns no value, SendCommandReturns (mock setter) returns no value, and the suite_test.go file exists at pkg/handler/suite_test.go.",
"comments": [],
"concerns_addressed": [
"correctness: format target reorder — addressed: gofmt now correctly runs after goimports-reviser and golines per the comment",
"correctness: golangci-lint v2.13.1 and errcheck v1.20.0 — addressed: these versions support Go 1.27",
"tests: reflect.Ptr fix for Go 1.27 — addressed: reflect.Pointer is the correct constant in Go 1.27",
"ast-grep no-bare-error-call on ServeHTTP calls — not an issue: http.Handler.ServeHTTP has void signature, returns no error",
"ast-grep no-bare-error-call on SendCommandReturns — not an issue: mock setter returns no value",
"ast-grep suite-test-file-required — not an issue: pkg/handler/suite_test.go exists with TestHandler → ginkgo.RunSpecs"
]
}

@bborbe
bborbe merged commit 69ab7bb into masterAug 22, 2026
1 check passed
@bborbe
bborbe deleted the fix/go127 branch August 22, 2026 09:50
Sign up for freeto 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

@bborbe