Skip to content

Releases: mpyw/gormreuse

v0.18.1

Choose a tag to compare

@github-actions github-actions released this 15 Sep 16:37
Immutable release. Only release title and notes can be modified.
c3b5677

Changelog

v0.18.0

Choose a tag to compare

@github-actions github-actions released this 15 Sep 13:03
Immutable release. Only release title and notes can be modified.
72aaf6d

Changelog

  • 72aaf6d Adopt declscope, and move the boundaries to where the units are (#129)

v0.17.0

Choose a tag to compare

@github-actions github-actions released this 01 Sep 03:53
Immutable release. Only release title and notes can be modified.
2d52be9

Changelog

  • 2d52be9 feat: publish prebuilt binaries and document mise install (#127)

v0.16.0

Choose a tag to compare

@mpyw mpyw released this 22 Aug 01:40
98aa364

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

Choose a tag to compare

@mpyw mpyw released this 22 Jul 03:07
d38be83

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

Choose a tag to compare

@mpyw mpyw released this 07 Jul 05:59
671bc6b

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

Choose a tag to compare

@mpyw mpyw released this 06 Jul 17:19
cc762f2

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

Full Changelog: v0.13.2...v0.14.0

v0.13.2

Choose a tag to compare

@mpyw mpyw released this 27 Dec 07:51
8f5f055

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-return to supported directives list
  • README cleanup

    • Removed retracted versions warning (handled by go.mod retract directive)

Full Changelog

v0.13.1...v0.13.2

v0.13.1

Choose a tag to compare

@mpyw mpyw released this 27 Dec 07:40
e758213

What's Changed

Bug Fixes

  • Fix incorrect unused directive detection logic (#51, #52)

    • //gormreuse:pure and //gormreuse:immutable-return were incorrectly reported as unused
    • Changed detection from "was consulted during analysis" to "does the function have a valid signature"
    • //gormreuse:pure is now unused only if function has NO *gorm.DB in parameters
    • //gormreuse:immutable-return is now unused only if function has NO *gorm.DB in return values
  • Treat interface types as potentially containing *gorm.DB

    • interface{} parameters/returns are now valid for directives (can hold *gorm.DB at runtime)
  • Also check for gorm.DB (non-pointer) type

    • gorm.DB by value is also dangerous because it contains *Statement which is shared when copied

Improvements

  • Improve pointer chain detection in closure captures
    • Recursively unwrap **gorm.DB, ***gorm.DB, etc. in ClosureCapturesGormDB
    • Add containsGormDBThroughPointers() for consistent pointer chain handling

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

Choose a tag to compare

@mpyw mpyw released this 27 Dec 06:02
5cddb83

What's Changed

New Features

  • Support //gormreuse:pure and //gormreuse:immutable-return directives on closures (#48)
  • Detect unused //gormreuse:pure and //gormreuse:immutable-return directives (#49)

Bug Fixes

  • Optimize hasCodeBeforeComment to avoid timeout on large files (#50)

Performance Improvements

  • Use inspector.Preorder for faster AST traversal (~40% improvement)
  • Cache ast/inspector.Inspector per file to avoid recreation
  • Cache fix.Generator across violations in the same analysis run
  • Add t.Parallel for faster test execution

Full Changelog: v0.12.0...v0.13.0