Skip to content

Add compact "Scan" section to human scan output#10

Closed
rdzehtsiar wants to merge 1 commit into
masterfrom
codex/add-scan-section-to-human-output
Closed

Add compact "Scan" section to human scan output#10
rdzehtsiar wants to merge 1 commit into
masterfrom
codex/add-scan-section-to-human-output

Conversation

@rdzehtsiar

Copy link
Copy Markdown
Owner

Motivation

  • Human-friendly terminal output lacked concise execution context that is already present in the JSON summary, making it hard for users to understand what ran without re-running --json.
  • The change aims to surface scan type, file counts, Git history mode, commits processed/total (or unknown), and duration in a stable, minimal format for first-time terminal users.

Description

  • Add a new render_scan function that formats a compact Scan section with Type, Files: <analyzed>/<detected> analyzed, Git history, Commits: <processed>/<total|unknown>, and Duration: <duration_ms> ms.
  • Insert the Scan section into the human output immediately after the Risk section by extending render_scan_summary with render_scan(&run.scan).
  • Keep the machine-readable JSON output unchanged (no schema or JSON field changes were made). The new section only affects the human text rendering.
  • Update tests in src/pipeline/scan_summary.rs and integration tests in tests/scanner_cli.rs to assert presence of the new Scan section for both Git and non-Git runs and to keep asserting that raw JSON-style keys (e.g., files_detected, files_analyzed, git_history) are not accidentally printed in human output.

Testing

  • Ran cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings, and the full test suite with cargo test; all tests passed.
  • Updated and exercised unit tests in src/pipeline/scan_summary.rs to validate render_scan output, and integration tests in tests/scanner_cli.rs to cover both Git and non-Git scan summaries; they succeeded.

Codex Task

@sonarqubecloud

Copy link
Copy Markdown

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

Qodana for Rust

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at qodana-support@jetbrains.com

@rdzehtsiar rdzehtsiar closed this Jun 20, 2026
@rdzehtsiar rdzehtsiar deleted the codex/add-scan-section-to-human-output branch June 20, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants