Upgrade HTML output to support various CLI options#4682
Open
uttam282005 wants to merge 6 commits intoaboutcode-org:developfrom
Open
Upgrade HTML output to support various CLI options#4682uttam282005 wants to merge 6 commits intoaboutcode-org:developfrom
uttam282005 wants to merge 6 commits intoaboutcode-org:developfrom
Conversation
…license-clarity-score in HTML output The HTML output now supports --license-text, --license-text-diagnostics, --summary,--license-clarity-score Signed-off-by: uttam282005 <uttam282005@gmail.com>
Signed-off-by: uttam282005 <uttam282005@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR adds support for additional CLI options (--license-text, --license-text-diagnostics, --summary, --license-clarity-score) in HTML output to match functionality available in JSON/YAML formats.
Changes:
- Added template sections for Scan Summary and License Clarity Score display
- Enhanced Copyrights and Licenses table with new column for matched text and diagnostics using collapsible HTML5 details/summary elements
- Modified output_html.py to pass summary parameter through the template generation pipeline
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| src/formattedcode/templates/html/template.html | Added Scan Summary section, License Clarity Score table, and matched text/diagnostics column with collapsible display |
| src/formattedcode/output_html.py | Modified to extract and pass summary data, matched_text, and matched_text_diagnostics to template |
| tests/formattedcode/test_output_templated.py | Added integration tests for the new HTML output features |
Comments suppressed due to low confidence (2)
src/formattedcode/output_html.py:160
- Outdated docstring. The function signature includes a summary parameter, but the docstring doesn't document it. Update the docstring to describe the summary parameter.
"""
Write scan output `results` to the `output_file` opened file using a template
file at `template_loc`.
Raise an exception on errors.
"""
src/formattedcode/output_html.py:200
- Outdated docstring. The function signature includes license_references and summary parameters, but the docstring only mentions results and version. Update the docstring to describe all parameters including license_references and summary.
"""
Yield unicode strings from incrementally rendering `results` and `version`
with the Jinja `template` object.
"""
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: uttam282005 <uttam282005@gmail.com>
Signed-off-by: uttam282005 <uttam282005@gmail.com>
Signed-off-by: uttam282005 <uttam282005@gmail.com>
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.
Fixes #3281
Description
This PR adds support for additional CLI options in HTML output to match the functionality available in JSON/YAML formats:
--license-text: Display matched license text--license-text-diagnostics: Show diagnostic information for license matches--summary: Display scan summary with declared license and holder information--license-clarity-score: Show license clarity score breakdownChanges Made
Template Changes (
src/formattedcode/templates/html/template.html)<details>/<summary>elements for collapsible sections--license-textis used--license-text-diagnosticsis usedCode Changes (
src/formattedcode/output_html.py)generate_output()to passsummaryparameter totemplate.generate()process_codebase()- just needed to be passed throughTesting
Tested with various command combinations: