feat(privacy): add --format json, --output flags and summary to scan results (#31) - #32
Open
shabbirAlam wants to merge 2 commits into
Open
feat(privacy): add --format json, --output flags and summary to scan results (#31)#32shabbirAlam wants to merge 2 commits into
shabbirAlam wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d3d9af5. Configure here.
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 #31
Problem
greenlight privacy /path --format json failed with Error: unknown flag: --format, while codescan, preflight and playscan all support --format json / --output. Privacy JSON output also lacked the summary object (total, critical, high, warns, infos, files_scanned, passed) present in other scanners.
Solution
Bring privacy to parity with other commands.
Verification
make build
1. JSON to stdout (now works)
./build/greenlight privacy /path/to/project --format json
2. JSON to file
./build/greenlight privacy /path/to/project --format json --output report.json
cat report.json # contains summary + elapsed
3. Terminal unchanged (default)
./build/greenlight privacy /path/to/project
4. Tests
make test # all pass
Example output (--format json):
{
"project_path": "/path/to/project",
"has_privacy_info": false,
"detected_apis": ["User Defaults"],
"summary": {
"total": 2,
"critical": 2,
"high": 0,
"warns": 0,
"infos": 0,
"files_scanned": 0,
"passed": false
},
"elapsed": "290ms"
}
Checklist
Note
Low Risk
CLI-only reporting changes with default terminal behavior preserved; no auth or data-path changes.
Overview
Brings
greenlight privacyin line with codescan, preflight, and playscan by adding--format(terminaldefault,json) and--outputto write reports to a file instead of stdout.JSON mode skips the colored banner, emits an indented payload that embeds the scan result plus
elapsed, and includes a newsummaryblock (counts by severity,files_scanned,passed) computed at the end ofprivacy.Scan. Terminal rendering is unchanged in content but now writes through a sharedio.Writerso the same report can go to stdout or a file.Reviewed by Cursor Bugbot for commit 9579d82. Bugbot is set up for automated code reviews on this repo. Configure here.