Releases: mpyw/gormreuse
Releases · mpyw/gormreuse
Release list
v0.18.1
v0.18.0
v0.17.0
v0.16.0
What's Changed
- chore(deps): bump actions/setup-go from 6.5.0 to 7.0.0 by @dependabot[bot] in #124
- feat: support Go 1.27 by @mpyw in #125
Full Changelog: v0.15.0...v0.16.0
v0.15.0
What's Changed
- [Claude] Remove MCP configuration from the repository by @mpyw in #115
- [Claude] Add Dependabot configuration by @mpyw in #116
- chore(deps): bump actions/checkout from 4 to 7 by @dependabot[bot] in #119
- chore(deps): bump actions/setup-go from 5 to 6 by @dependabot[bot] in #120
- chore(deps): bump golangci/golangci-lint-action from 7 to 9 by @dependabot[bot] in #117
- chore(deps): bump codecov/codecov-action from 5 to 7 by @dependabot[bot] in #118
- chore(deps): bump actions/setup-go from 6 to 6.5.0 in the actions-minor group by @dependabot[bot] in #122
- fix: validate the immutable-return body contract (mutable returns were silently trusted) by @mpyw in #123
Full Changelog: v0.14.1...v0.15.0
v0.14.1
What's Changed
- feat: recognize //gormreuse:immutable-param directive (Phase 1b stage 1, #61) by @mpyw in #106
- feat: treat *gorm.DB parameters as mutable roots by default (Phase 1b stage 2a, #61) by @mpyw in #107
- feat: detect redundant //gormreuse:immutable-param directives (#61) by @mpyw in #108
- feat: parameter-root immutable-param fix + migration docs (Phase 1b stage 2c/2d, #61) by @mpyw in #109
- feat: Connection/FindInBatches callbacks are immutable (Phase 2 Part A, #62) by @mpyw in #110
- feat: //gormreuse:immutable-input(name) directive (Phase 2 Part B, #62) by @mpyw in #111
- feat: temporary Scopes-callback Session/WithContext/Debug warning (Phase 3, #63) by @mpyw in #112
- fix: mark loop blocks by reachability, not index interval (fixes #113) by @mpyw in #114
Full Changelog: v0.14.0...v0.14.1
v0.14.0
What's Changed
- refactor: use external tests and add t.Parallel() by @mpyw in #53
- fix: revert internal tests to internal package by @mpyw in #54
- chore(deps): bump filippo.io/edwards25519 from 1.1.0 to 1.1.1 in /e2e/internal by @dependabot[bot] in #58
- fix: gate builtin immutable-return matching on gorm package/receiver (#64) by @mpyw in #78
- fix: don't pollute *gorm.DB passed to read-only variadic stdlib calls (#65) by @mpyw in #79
- fix: detect reuse across defer/goroutine-only branches (#67) by @mpyw in #80
- fix: keep tracking *gorm.DB across interface round-trip (#69) by @mpyw in #81
- fix: treat any pre-package ignore as file-level (#70) by @mpyw in #82
- fix: directive matching — multi-assign poisoning and block comments (#72) by @mpyw in #83
- docs: fix pure example to satisfy the strict pure contract (#73) by @mpyw in #84
- chore: sync directive_validation.go.diff with #72 fixtures by @mpyw in #85
- fix: detect non-call leaks in //gormreuse:pure validation (#66) by @mpyw in #86
- fix: directive matching — package-level var closures and interface unused-detection (#72) by @mpyw in #87
- feat: Phase 1a — Scopes/Preload callback params as mutable roots (#60) by @mpyw in #88
- chore: panic guard, cmd smoke test, *_test.go trap doc (#77) by @mpyw in #89
- chore: enable complexity linters, fix stale tracer docs (#77) by @mpyw in #90
- chore: dedup golden/diff pipeline into internal/goldentest (#77) by @mpyw in #91
- test: direct unit tests for internal/ssa/cfg (#75) by @mpyw in #92
- test: direct unit tests for internal/ssa/purity (#75) by @mpyw in #93
- test: direct unit tests for internal/ssa/tracer (#75) by @mpyw in #94
- test: direct unit tests for internal/ssa/handler (#75) by @mpyw in #95
- test: direct unit tests for internal/fix (#75 stage 1 complete) by @mpyw in #96
- refactor: dedup tracer immutable-check and free-var resolution (#75 stage 2) by @mpyw in #97
- refactor: dedup tracer alloc/field store scans and Phi-edge collection (#75 stage 2) by @mpyw in #98
- feat: actionable reuse diagnostics with root + first-branch positions (#76) by @mpyw in #99
- test: rebuild E2E suite — single module, hard assertions, CI, clone-semantics (#74) by @mpyw in #100
- fix: skip provably-dead closures to avoid false positives (#68 fix-direction-1) by @mpyw in #101
- fix: alias-aware Session qualifier in suggested fixes (#71 defect 3) by @mpyw in #102
- fix: treat FirstOrCreate/FirstOrInit as finishers in fix generation (#71 secondary) by @mpyw in #103
- fix: order closure captured-uses by call-site position (#68 fix-direction-2) by @mpyw in #104
- fix: converging suggested fixes + convergence harness (#71 defects 1 & 2) by @mpyw in #105
New Contributors
- @dependabot[bot] made their first contribution in #58
Full Changelog: v0.13.2...v0.14.0
v0.13.2
Documentation Updates
This release contains documentation improvements across the codebase:
Changes
-
Expanded purity package documentation (
internal/ssa/purity/validator.go)- Added detailed Pure Contract explanation
- Documented SSA-based derivation tracking analysis strategy
- Clarified what pure functions CAN do
-
Improved doc comment accuracy (
analyzer.go)- Fixed Session() placement explanation (now correctly shows
.Session()at end of chain) - Added
//gormreuse:immutable-returnto supported directives list
- Fixed Session() placement explanation (now correctly shows
-
README cleanup
- Removed retracted versions warning (handled by go.mod retract directive)
Full Changelog
v0.13.1
What's Changed
Bug Fixes
-
Fix incorrect unused directive detection logic (#51, #52)
//gormreuse:pureand//gormreuse:immutable-returnwere incorrectly reported as unused- Changed detection from "was consulted during analysis" to "does the function have a valid signature"
//gormreuse:pureis now unused only if function has NO*gorm.DBin parameters//gormreuse:immutable-returnis now unused only if function has NO*gorm.DBin return values
-
Treat interface types as potentially containing
*gorm.DBinterface{}parameters/returns are now valid for directives (can hold*gorm.DBat runtime)
-
Also check for
gorm.DB(non-pointer) typegorm.DBby value is also dangerous because it contains*Statementwhich is shared when copied
Improvements
- Improve pointer chain detection in closure captures
- Recursively unwrap
**gorm.DB,***gorm.DB, etc. inClosureCapturesGormDB - Add
containsGormDBThroughPointers()for consistent pointer chain handling
- Recursively unwrap
Refactoring
- Extract signature validation to separate file (
signature.go) - Add comprehensive tests for type checking (generic types, containers, cycle detection)
Retracted Versions
- v0.13.0 is retracted due to incorrect unused directive detection logic
Design Summary
| Function | Purpose | Pointer Chain | interface{} | struct fields |
|---|---|---|---|---|
typeutil.IsGormDB |
SSA analysis | 1 level only | ✗ | ✗ |
containsGormDBThroughPointers |
Closure capture | Recursive | ✗ | ✗ |
containsGormDB |
Directive validation | Recursive | ✓ | ✓ |
Full Changelog: v0.13.0...v0.13.1
v0.13.0
What's Changed
New Features
- Support
//gormreuse:pureand//gormreuse:immutable-returndirectives on closures (#48) - Detect unused
//gormreuse:pureand//gormreuse:immutable-returndirectives (#49)
Bug Fixes
- Optimize
hasCodeBeforeCommentto avoid timeout on large files (#50)
Performance Improvements
- Use
inspector.Preorderfor faster AST traversal (~40% improvement) - Cache
ast/inspector.Inspectorper file to avoid recreation - Cache
fix.Generatoracross violations in the same analysis run - Add
t.Parallelfor faster test execution
Full Changelog: v0.12.0...v0.13.0