Skip to content

Add repeatable --ignore option to structpad check - #1

Merged
Gulliby merged 1 commit into
mainfrom
feature/structpad-check-ignore
Oct 13, 2026
Merged

Gulliby merged 1 commit into
mainfrom
feature/structpad-check-ignore

Conversation

@Gulliby

@Gulliby Gulliby commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Requested by gulliby

Adds a repeatable --ignore NAME option to structpad check.

Before

A single legacy struct (a wire or file format whose layout cannot change) made structpad check --max-padding N fail for good, or forced a limit that was too loose for every other struct.

After

--ignore NAME (or --ignore=NAME, repeatable, check only) leaves the named structs out of the padding check. The summary line gets a (M ignored) suffix; ignored structs still count in the total.

structpad check --ignore Packet net.sp
Frame: 12 bytes of padding (limit 0)
1 of 3 structs over the padding limit (1 ignored)

Invalid names exit 2 with invalid --ignore "VALUE"; names not defined in the file exit 2 with unknown struct "NAME" in --ignore. Without --ignore the output is unchanged.

How

  • src/structpad/cli.py: option parsing, name validation, unknown-name check, exit code skips ignored structs; usage line updated.
  • src/structpad/render.py: render_check takes an optional set of ignored names.
  • Tests: new tests/test_ignore.py, the usage literal in tests/test_cli.py, and a README check in tests/test_readme.py.
  • README.md: documents the option. No dependency or CI changes.

Named structs are left out of the padding check and are reported in the summary as ignored.
@Gulliby
Gulliby merged commit bf43dc8 into main Oct 13, 2026
12 checks passed
@Gulliby
Gulliby deleted the feature/structpad-check-ignore branch October 13, 2026 21:59
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