Skip to content

feat: -sort orders inspect layouts by struct size#37

Merged
peczenyj merged 1 commit into
develfrom
feature/sort-inspect
May 26, 2026
Merged

feat: -sort orders inspect layouts by struct size#37
peczenyj merged 1 commit into
develfrom
feature/sort-inspect

Conversation

@peczenyj

Copy link
Copy Markdown
Owner

Extends -sort (added for diff in #36) to inspect mode: layouts across all scanned packages are collected and ordered largest-first by Layout.Total (stable sort). Help text now reads "diff: by bytes saved; inspect: by struct size". Diff behavior is unchanged.

While testing this I found that inspect's default order is alphabetical (layout.Layouts does sort.Strings), so the test fixture uses Alpha (24B) / Zeta (40B) where alphabetical and size-descending genuinely differ — otherwise the sort would be untestable.

Tests: -inspect -sort renders the larger struct first; default inspect order (alphabetical) is unchanged. task ci green (91 tests).

⚠️ Stacked on #36 (base feature/sort-diff) to keep moving during the GitHub Actions incident. I'll retarget the base to devel once #36 merges. Closes #30 (the -sort feature, both modes).

Closes #30

🤖 Generated with Claude Code

@peczenyj peczenyj self-assigned this May 26, 2026
@codecov-commenter

codecov-commenter commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.55%. Comparing base (e6ee493) to head (3f2d2fd).

Additional details and impacted files
@@            Coverage Diff             @@
##            devel      #37      +/-   ##
==========================================
+ Coverage   85.45%   85.55%   +0.10%     
==========================================
  Files          10       10              
  Lines         708      713       +5     
==========================================
+ Hits          605      610       +5     
  Misses         65       65              
  Partials       38       38              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@peczenyj peczenyj changed the base branch from feature/sort-diff to devel May 26, 2026 13:58
In -inspect mode, -sort now collects all layouts across packages and
orders them largest-first by Layout.Total (stable sort). Updates the flag
help to cover both modes. Diff behavior unchanged.

Closes #30

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@peczenyj peczenyj force-pushed the feature/sort-inspect branch from e7748d8 to 3f2d2fd Compare May 26, 2026 14:36
@peczenyj peczenyj merged commit cb93846 into devel May 26, 2026
6 checks passed
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.

feat: -sort flag (diff + inspect)

2 participants