Enable command-line argument for pretty printing XML output (#268)#295
Enable command-line argument for pretty printing XML output (#268)#295ermahesh wants to merge 2 commits intousnistgov:developfrom
Conversation
|
@ermahesh - Thank you for your contributions. We will review the code and test the functionality. |
selenaxiao-nist
left a comment
There was a problem hiding this comment.
@ermahesh Please change PrettyPrinter class to use SaxonTransformerFactory. Refer to XMLOperations class
|
@selenaxiao-nist @iMichaela : I see the build fails for a different reason , Should we fixing that as part of this PR ? |
|
Ideally - yes. Due to more recent policy on open-source, we might, for now, just temporarily remove the Maven release, and include guidance for users to build locally the liboscal-java and oscal-cli using the latest OSCAL release. |
|
@iMichaela What can I do to ensure this code is merged ? |
The PR cannot be merged as long as the tests performed by the CI/CD pipeline are not passing and the locally generated oscal-cli is tested. So far, the CI/CD pipeline has plenty of error which @selenaxiao-nist reproduced locally too when she tried to build the tool locally (without code release tests). She can provide more updates. You can work with her directly if you believe your code is not generating any errors when you build it locally. I am suggesting a v-meeting - please send an email to oscal@nist.gov to connect with our team. |
|
Are you able to build this locally with no errors? Do your unit tests pass? |
|
It appears that pretty printing only works for profile resolution. Is there a reason that the feature was only implemented in that code path, or am I misreading the PR? |
@rsherwood-nist This is my first contribution to the project — could you please help me understand if this fix needs to be applied in other parts of the codebase as well. |
This feature enables formatted XML, JSON, and YAML output for the resolve-profile command, improving readability of the generated files. - Added PrettyPrinter utility class for formatting output files - Added --pretty-print CLI option to AbstractResolveCommand - Added unit tests for the PrettyPrinter utility - Added CLI integration tests for pretty-print functionality Original contribution by Mahesh Kumar Gaddam (ermahesh) Based on usnistgov/oscal-cli#295 Addresses usnistgov/oscal-cli#268
This feature enables formatted XML, JSON, and YAML output for the resolve-profile command, improving readability of the generated files. - Added PrettyPrinter utility class for formatting output files - Added --pretty-print CLI option to AbstractResolveCommand - Added unit tests for the PrettyPrinter utility - Added CLI integration tests for pretty-print functionality Original contribution by Mahesh Kumar Gaddam (ermahesh) Based on usnistgov/oscal-cli#295 Addresses usnistgov/oscal-cli#268
Committer Notes
Fixes #268
This PR introduces a new command-line argument to enable pretty-printed XML output in the CLI tool.
Key Enhancements:
--pretty-printCLI flag to toggle formatted XML output.FileOutputStreamwithFiles.newOutputStream(...)for PMD compliance.Additional Notes:
Submission Checklist:
Core Feature Checklist: