feat: add optional CSV export for findings and warnings#25
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c5c43718b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
src/report.cpp
Outdated
| std::filesystem::remove(findings_csv_path); | ||
| std::filesystem::remove(warnings_csv_path); |
There was a problem hiding this comment.
Avoid deleting existing CSV outputs by default
When --csv is not passed, write_reports now unconditionally calls std::filesystem::remove on findings.csv and warnings.csv. This turns a read/overwrite-only run into a destructive operation: a normal invocation (especially with the default output directory of the current working directory) can delete pre-existing files that were not created by this run, and can also fail on permission errors for those stale files even though CSV export was not requested.
Useful? React with 👍 / 👎.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closes #23
Summary
--csvCLI option for optional CSV exportfindings.csvandwarnings.csvonly when CSV is explicitly requested.gitattributesguardrail so core text files are normalized to LF in the repositoryScope
This PR is limited to report and output-format behavior.
It does not change parser behavior, detector thresholds, enrichment, cross-host correlation, or existing Markdown/JSON report semantics.
This is a report-only change; no detector thresholds changed.
What changed
--csvas an explicit CLI flagfindings.csvandwarnings.csvfixtures for one single-host and one multi-host sanitized case.gitattributesto reduce future LF/CRLF drift for shared text filesCSV schema
findings.csvrulesubject_kindsubjectevent_countwindow_startwindow_endusernamessummarywarnings.csvkindmessageVerification
src/main.cpp,src/report.cpp, andtests/test_report_contracts.cppare normal multiline text files locallycmake --preset dev-debugcmake --build --preset dev-debugctest --preset dev-debugcmake --preset ci-releasecmake --build --preset ci-releasectest --preset ci-releaseDeferred