Skip to content

fix(report): neutralize formula cells in findings CSV export - #340

Merged
BaaRai merged 1 commit into
BaaRai:mainfrom
Coff0xc:fix/csv-formula
Nov 18, 2026
Merged

BaaRai merged 1 commit into
BaaRai:mainfrom
Coff0xc:fix/csv-formula

Conversation

@Coff0xc

@Coff0xc Coff0xc commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

FindingsCSV wrote finding name, class, summary, and task description through encoding/csv, which only quotes delimiters. Spreadsheet apps still evaluate a cell that starts with =, +, -, @, tab, or CR.

Those text fields now get a leading ' so the export opens as data. IDs and counts are unchanged.

Tested: go test ./report -run TestFindingsCSVNeutralizesFormulas pass.

FindingsCSV wrote name, class, summary, and task text as-is. A value
starting with =, +, -, @, tab, or CR is evaluated as a formula when
the file is opened in Excel or LibreOffice. Those cells are now
prefixed with a single quote.
Copilot AI balanced review requested due to automatic review settings November 18, 2026 17:06

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@BaaRai BaaRai left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed: csvCell covers every text column and leaves IDs and counts untouched; the test checks the BOM, the quoting, and that a plain severity is not prefixed. CI green.

@BaaRai
BaaRai merged commit 3bbda77 into BaaRai:main Nov 18, 2026
6 checks passed
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.

3 participants