Skip to content

Add --min-saving to structpad suggest - #5

Merged
Gulliby merged 1 commit into
mainfrom
feature/structpad-suggest-min-saving
Nov 5, 2026
Merged

Gulliby merged 1 commit into
mainfrom
feature/structpad-suggest-min-saving

Conversation

@Gulliby

@Gulliby Gulliby commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Requested by gulliby

Before

structpad suggest printed a block for every struct, also for a struct that is packed already or saves only a few bytes.

After

structpad suggest --min-saving N prints only the structs whose suggested order saves at least N bytes. N is a whole number with 1 to 6 digits, checked like the value of --max-padding. The default is 0, so without the option nothing changes. A struct that saves exactly N is kept. When every struct is left out, the output is no struct saves at least N bytes and the exit status is 0. layout and check refuse the option.

How

  • src/structpad/cli.py: the option, its value check and the refusal in the other commands. src/structpad/render.py: the filter and the empty-result line.
  • tests/test_min_saving.py has 23 new tests. tests/test_cli.py and tests/test_readme.py change for the usage text.
  • README.md: the usage block and the description of suggest.
  • 174 tests pass (150 before). ruff check . is clean.

Made by a BAKED bench run (round 100, sdd workflow, run e6b9835d).

🤖 Generated with Claude Code

Made by a BAKED bench run (round 100).
@Gulliby
Gulliby merged commit 20f34d3 into main Nov 5, 2026
12 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.

1 participant