Skip to content

ci: lint the example module - #162

Closed
tthayer wants to merge 1 commit into
mainfrom
worktree-iga-3723-lint-example-module
Closed

ci: lint the example module#162
tthayer wants to merge 1 commit into
mainfrom
worktree-iga-3723-lint-example-module

Conversation

@tthayer

@tthayer tthayer commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

What

Adds example/ to the go-lint CI job and fixes the 27 findings that were hiding there.

example/ is a separate Go module, so the root golangci-lint invocation never reached it — despite it carrying every integration test in the repo, including the only coverage of the partitioned-parent ALTER suppression (SQLSTATE 42809) added in #159/#160.

Findings fixed (27 → 0)

Fix Count
--fix (whitespace, godot) 9
revive var-naming: fakeTenantIdsfakeTenantIDs, masterSelectSqlmasterSelectSQL, fmtSqlfmtSQL, selectSqlselectSQL, eventIdseventIDs 14
forbidigo: dropped a leftover debug fmt.Println() 1
gosec G115: strconv.ParseInt(s, 2, 64)ParseUint(s, 2, 8) in bitStringToBytes, so the byte() conversion is structurally bounded rather than merely bounded in practice 1
revive line-length-limit: hoisted a 201-char query into const updatedPetQuery 1

The one config carve-out

gomoddirectives flags example/go.mod's replace github.com/ductone/protoc-gen-pgdb => ../, which is how the example module consumes the in-repo library and must stay.

Note this is not expressible via the existing replace-allow-list setting — that governs non-local replacements only, and the firing check here is the separate replace-local boolean. Rather than flip replace-local: true (which would disable the check for the root go.mod too), the exclusion is scoped to the single file.

Verified scoped, not blanket: with a local replace temporarily added to the root go.mod, gomoddirectives still fires on it.

Verification

  • golangci-lint run clean in both modules
  • go test ./... passes in both modules (example/ integration tests against PG16 + pgvector)

Closes IGA-3723.

🤖 Generated with Claude Code

example/ is a separate Go module, so the root golangci-lint invocation
never reached it -- it held 27 findings while carrying every integration
test in the repo, including the only coverage of the partitioned-parent
ALTER suppression.

gomoddirectives is excluded for example/go.mod alone: the module consumes
the in-repo library through a local replace, which is required and cannot
be expressed via replace-allow-list (that setting governs non-local
replacements only). Scoping it to the file keeps the check live for the
root go.mod.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jul 31, 2026

Copy link
Copy Markdown

IGA-3723

@tthayer
tthayer marked this pull request as ready for review July 31, 2026 22:15
@tthayer
tthayer marked this pull request as draft July 31, 2026 22:16
@tthayer

tthayer commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

Closing unmerged: linting example/ is test-only hygiene and not worth a permanent CI check. Branch retained if this is ever revisited.

@tthayer tthayer closed this Jul 31, 2026
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.

1 participant