Skip to content

v2.0.1: world-class CLI output + accuracy fixes#42

Merged
harekrishnarai merged 4 commits into
mainfrom
improve/cli-readability
Jun 9, 2026
Merged

v2.0.1: world-class CLI output + accuracy fixes#42
harekrishnarai merged 4 commits into
mainfrom
improve/cli-readability

Conversation

@harekrishnarai

Copy link
Copy Markdown
Owner

Summary

A patch release focused on terminal UX and finding accuracy.

CLI output (semgrep-class)

The default report is reworked into a polished layout:

  • colored title + per-file headers with finding counts
  • each finding shows a severity-colored marker, the rule, and the line
  • a pinpointed multi-line code snippet with a line-number gutter — context
    lines dimmed, the offending line marked and highlighted
  • description / fix: / AI notes wrap to the terminal width with hanging indents
  • width-aware summary footer with color-coded counts

json/sarif/yaml/markdown output is unchanged.

Accuracy fixes

  • IMPOSTOR_COMMIT: a benign git config user.name "github-actions[bot]"
    was reported CRITICAL whenever its run block contained ${...} anywhere
    (and mis-located to the first run:). Now each run-block line is evaluated
    independently — official bot identity is LOW, variable-based identity is
    CRITICAL — each pinpointed to its exact line.
  • GITHUB_ENV_UNTRUSTED_WRITE: points at the exact >> $GITHUB_ENV line
    inside the run block instead of the run: block-scalar line.

Verification

go build / go vet / go test ./... — 23/23 packages pass. Validated on
real scans of cli/cli and git/git.

The minimal CLI report printed descriptions, fix hints, and links as single
long lines that ran off the terminal and wrapped raggedly. Rework the renderer
to:
- wrap description / fix / AI-reasoning / evidence to the terminal width
  (via terminal.Width(), clamped 60–120) with clean hanging indents
- tighten indentation (file at column 0 with a finding count, details at 4)
- render the fix with a "→" prefix and aligned continuation lines
- truncate over-long offending-code lines instead of overflowing

No change to the json/sarif/yaml/markdown formats.
Rework the CLI renderer into a semgrep-class layout:
- a colored title and per-file headers with finding counts
- each finding shows a severity-colored "❯" marker, the rule, and the line
- a multi-line code snippet with a line-number gutter: context lines are
  dimmed and the offending line is marked "❱" and highlighted
- description / fix / AI notes wrap to the terminal width with clean hanging
  indents; over-long code lines are truncated with an ellipsis
- a width-aware summary footer with color-coded counts

json/sarif/yaml/markdown output is unchanged.
- IMPOSTOR_COMMIT: evaluate each line of a run block independently. Previously
  a benign `git config user.name "github-actions[bot]"` was escalated to
  CRITICAL whenever the block contained any `${...}` elsewhere, and the finding
  was mis-located to the first `run:` line. Now the official bot identity is
  LOW and a variable-based identity is CRITICAL, each pinpointed to its line.
- GITHUB_ENV_UNTRUSTED_WRITE: locate the exact offending `>> $GITHUB_ENV` line
  inside the run block (and use it as evidence) instead of the `run:` block line.
@harekrishnarai harekrishnarai merged commit 5ef5197 into main Jun 9, 2026
4 checks passed
@harekrishnarai harekrishnarai deleted the improve/cli-readability branch June 9, 2026 16:18
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant