chore(lint): enable strict errorlint#1008
Merged
cpcloud merged 3 commits intoMay 21, 2026
Merged
Conversation
errorlint was already enabled via `default: all` but ran with upstream defaults (comparison + asserts only). Lock in the stricter `errorf` and `errorf-multi` checks so future regressions to `%v`-wrapped errors get caught at lint time. Codebase is already clean against these settings.
Extract semantic constants where the literal carries meaning: - `internal/llm/client.go`: provider names (`providerLlamacpp`, `providerAnthropic`, `providerOpenAI`, etc.) so `localProviders` and the `createProvider` switch share a single source of truth. - `internal/extract/ocr_progress.go`: `toolPDFToCairo` / `toolTesseract` for the strings emitted in `AcquireToolState.Tool`. - `internal/relay/pgstore.go`: `lockForUpdate` for the GORM `clause.Locking.Strength` used in five FOR UPDATE call sites. - `internal/extract/sqlcontext.go`: use existing `data.ColName`. - `internal/extract/llmextract_test.go`: use existing `MIMEApplicationPDF` for the in-package fixtures. Disable `goconst` in `.golangci.yml`: it produced 400+ findings here, the overwhelming majority on UI labels, JSON test fixtures, and SQL keywords where the literal IS the value. Also disable `gomodguard` (superseded by `gomodguard_v2` in golangci-lint, which is already enabled via the default-all set).
Update .claude/codebase/*.md to reflect the current layout: - Add the packages that have landed since the last refresh: relay (Postgres + RLS), sync (encrypted oplog engine), crypto (NaCl keys and box encryption), mcp (Model Context Protocol server), sqlfmt (extracted SQL pretty-printer), address (postal-code lookup), uid (ULID wrapper). - Document the SyncOplogEntry / SyncDevice models and the WithSyncApplying context flag that suppresses oplog writes on remote-apply. - Note the relay Store interface (24 methods), the rlsdb.DB.Tx scoping rule, and the WithoutHousehold allowlist. - Capture per-entity store_*.go file split and the new oplog.go / fts.go / defaults.go files in internal/data/. - Add the errorlint strict configuration to the patterns reference.
1048052 to
ac96e0b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
errorf+errorf-multi+comparison+asserts) in.golangci.yml. The codebase passes cleanly across 700+fmt.Errorfcall sites.MIMEApplicationPDFconstant for the in-packageinternal/extract/llmextract_test.gofixtures..claude/codebase/*.mdto cover the packages that have landed since the last verification:relay,sync,crypto,mcp,sqlfmt,address,uid. Document the sync oplog hooks, therlsdb.DB.Txscoping rule, and the per-entitystore_*.gosplit ininternal/data/.The original branch also extracted provider/tool/lock constants and converted backward loops to
slices.Backward, butmainlanded equivalent (often broader) changes in #1006 first, so those commits dropped out during rebase. What's left is the errorlint pin, the test-fixture cleanup, and the codebase-map refresh.