Repository navigation
Add repeatable --ignore option to structpad check - #1
Merged
Merged
Conversation
Named structs are left out of the padding check and are reported in the summary as ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by gulliby
Adds a repeatable
--ignore NAMEoption tostructpad check.Before
A single legacy struct (a wire or file format whose layout cannot change) made
structpad check --max-padding Nfail for good, or forced a limit that was too loose for every other struct.After
--ignore NAME(or--ignore=NAME, repeatable,checkonly) leaves the named structs out of the padding check. The summary line gets a(M ignored)suffix; ignored structs still count in the total.Invalid names exit 2 with
invalid --ignore "VALUE"; names not defined in the file exit 2 withunknown struct "NAME" in --ignore. Without--ignorethe 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_checktakes an optional set of ignored names.tests/test_ignore.py, the usage literal intests/test_cli.py, and a README check intests/test_readme.py.README.md: documents the option. No dependency or CI changes.