feat: argparse for validate.py; pretty JSON output in schema generator - #184
Open
SoundMatt wants to merge 1 commit into
Open
feat: argparse for validate.py; pretty JSON output in schema generator#184SoundMatt wants to merge 1 commit into
SoundMatt wants to merge 1 commit into
Conversation
COVESA#101) - validate.py: replace bare sys.argv indexing with argparse, giving a proper usage message when arguments are missing - ifex_to_json_schema.py: capture print output via StringIO and re-emit it through json.dumps(indent=2), so the schema is pretty-printed without needing an external pipe - pretty_print_json.py: deleted; its function is now built into ifex_to_json_schema.py Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
Collaborator
|
Good fix, but CI/CD must be updated since these files use pretty_print_json.py:
Also since JSON publication is part of release flow, test first. |
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.
Closes #101
Changes
validate.py: Replace baresys.argvindexing withargparse. Running without arguments now prints a proper usage message instead of throwingIndexError. The--quietflag is preserved as a named argument.ifex_to_json_schema.py: Capture allprint()output viaio.StringIO/redirect_stdout, then parse and re-emit withjson.dumps(indent=2). The schema is now pretty-printed without needing an external pipe step.pretty_print_json.py: Deleted. Its sole purpose was piping the schema generator output throughjson.dumps; that is now done internally.Test