[PPSC-349] feat(output): add --summary-top flag for summary positioning#67
Merged
yiftach-armis merged 2 commits intomainfrom Feb 4, 2026
Merged
[PPSC-349] feat(output): add --summary-top flag for summary positioning#67yiftach-armis merged 2 commits intomainfrom
yiftach-armis merged 2 commits intomainfrom
Conversation
…fore findings Add a new --summary-top flag to the human format output that allows the summary dashboard to be displayed at the top of the output (before findings) instead of at the end. When enabled, the brief status line is also skipped to avoid redundancy.
🛡️ Armis Security Scan Results✅ No issues
Total: 0 View full resultsNo security issues found. |
Test Coverage Reporttotal: (statements) 79.3% Coverage by function |
There was a problem hiding this comment.
Pull request overview
This PR adds a --summary-top flag to display the summary dashboard at the top of the output (before findings) instead of at the end. This addresses user feedback requesting the ability to see high-level scan results first, particularly when redirecting output to a file.
Changes:
- Added
SummaryTopboolean field toFormatOptionsstruct - Modified
HumanFormatter.FormatWithOptionsto conditionally render summary at top or bottom based on flag - Added
--summary-toppersistent flag to the scan command, making it available for bothscan repoandscan imagesubcommands
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| internal/output/output.go | Added SummaryTop field to FormatOptions struct with consistent alignment |
| internal/output/human.go | Implemented conditional logic to display summary at top when flag is enabled; skips brief status line when full summary is shown at top |
| internal/cmd/scan_repo.go | Passes SummaryTop option from flag to formatter with consistent field alignment |
| internal/cmd/scan_image.go | Passes SummaryTop option from flag to formatter with consistent field alignment |
| internal/cmd/scan.go | Declares summaryTop package variable and registers --summary-top persistent flag |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…WE-770) Add bounds on memory allocation when loading code snippets to prevent potential denial-of-service from maliciously crafted files: - Maximum 10KB per line - Maximum 100KB total snippet size - Graceful truncation when limits are exceeded
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.
Related Issue
Type of Change
Problem
Users requested the ability to display the summary dashboard at the top of the human format output instead of at the end, especially when redirecting output to a file to see the high-level overview first without scrolling through findings.
Solution
Added a new
--summary-topflag to the scan commands that displays the summary dashboard before the findings section. When enabled, the brief status line is also skipped to avoid redundancy since the full summary provides the same information.Testing
Automated Tests
Reviewer Notes
The implementation follows the Options Pattern already used in the codebase (similar to
--group-by). The flag is a PersistentFlag on thescanCmd, so it's available for bothscan repoandscan imagecommands.