Repository navigation
Conversation
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
golangci-lint v2.15.0 ships exhaustive v0.15.0, which renames its options and replaces the per-kind explicit flags with one explicit-exhaustive flag. Map literals are now checked everywhere, and maps that are sparse on purpose opt out with //exhaustive:ignore or list every key explicitly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
torcolvin
force-pushed
the
exhaustive-v0.15-config
branch
from
November 7, 2026 00:57
68c4f4a to
8c35087
Compare
Contributor
|
Droid finished @torcolvin's task —— View job LGTM — no high-confidence, actionable issues found in the diff. 0 inline comments posted |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues are identified for the golangci-lint migration.
No open issues 🎉
What changed in this PR
Updates Sync Gateway’s lint configuration and tooling to golangci-lint v2.15.0, adapting enum-keyed maps to the new exhaustive checks.
Changes:
- Migrates exhaustive configuration keys and test exclusions in both lint configurations.
- Updates CI and pre-commit to v2.15.0.
- Adjusts map initialization and exemptions, completes index maps, and removes index-readiness metadata.
The PR description notes that CI depends on a separate fix for new errcheck findings.
| File | Description |
|---|---|
rest/server_context.go |
Initializes the server map with make. |
db/indexes.go |
Completes index maps and removes readiness queries and fields. |
db/changes.go |
Adds constructors for single-version change maps. |
base/audit_events.go |
Removes the redundant exhaustive enforcement directive. |
auth/jwt.go |
Exempts the supported-algorithm allowlist from exhaustive checks. |
.pre-commit-config.yaml |
Updates golangci-lint to v2.15.0. |
.golangci.yml |
Migrates exhaustive settings and test exclusions. |
.golangci-strict.yml |
Applies the same migration to strict lint settings. |
.github/workflows/ci.yml |
Updates the CI linter to v2.15.0. |
Review effort: Balanced
This branch has not been deployed
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.
golangci-lint v2.15.0 ships
exhaustivev0.15.0, which changes its configuration keys. On v2.15.0,golangci-lint config verifyrejects the currentexhaustivekeys in.golangci-strict.yml. This PR moves the config to the new keys and fixes the new findings.Config changes
check: mapis nowcheck: mapliteral.ignore-enum-members(one regex) is nowignore-constants(a list).indexTypeCountjoinsauditdSyncGatewayEndIDandlevelCountas an end-of-enum marker.explicit-exhaustive-mapis removed. v0.15 has oneexplicit-exhaustiveflag for switches and map literals together. It cannot check maps only with//exhaustive:enforcewhile it checks all switches. Map literals are now checked everywhere, and a map that is sparse on purpose opts out.missing cases in expression switch) and also covers map literals.Code changes for the map-literal findings
base/audit_events.go: removed//exhaustive:enforcefromAuditEvents. All map literals are checked now, so the directive is not needed. It also gave false warnings on the nestedAuditFieldsmaps.db/changes.go: addednewRevTreeChangeandnewCVChange. AChangeByVersionTypeholds one version type by design, and the constructors build it withmake, so no literal gets checked.db/indexes.go:indexFilterExpressions,readinessQueriesandpartitionableIndexesnow list every index type, with empty orfalsevalues in a commented section.GetSGIndexeschecksreadinessQuery != ""and not presence in the map, so only the three critical indexes stay marked as required.auth/jwt.go:SupportedAlgorithmskeeps//exhaustive:ignore. It is an allowlist keyed by a go-jose enum. With explicitfalseentries, each new go-jose algorithm breaks lint. Also,rest/config.gotreats any present key as supported.rest/server_context.go: an emptymap[serverType]*serverInfo{}literal is nowmake(...).Known CI failure
v2.15.0 also adds 18 errcheck findings, each a bare
<-doneChanreceive on achan errorinbase/anddb/. A separate PR fixes them, and that PR must merge first. Until then, the golangci job on this PR fails on errcheck only.Testing
golangci-lintv2.15.0 with CE and EE build tags: noexhaustivefindings.AuditEventsentry and oneindexNamesentry. Lint reported each missing key.dbandrestchanges-feed tests and theauth/restOIDC and JWT tests pass on CE and EE.Pre-review checklist
base.UD(docID),base.MD(dbName))docs/apiDependencies (if applicable)
Integration Tests
🤖 Generated with Claude Code