Skip to content

Export/Results as CSV#519

Open
stelgenhof wants to merge 3 commits into
raviqqe:mainfrom
stelgenhof:feature-csv
Open

Export/Results as CSV#519
stelgenhof wants to merge 3 commits into
raviqqe:mainfrom
stelgenhof:feature-csv

Conversation

@stelgenhof

@stelgenhof stelgenhof commented Jun 16, 2025

Copy link
Copy Markdown

Adds a new format to export the results to CSV.

Close #126.

Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
Signed-off-by: Sacha Telgenhof <me@sachatelgenhof.com>
@codecov

codecov Bot commented Jun 16, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.00000% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.75%. Comparing base (aefbe2d) to head (c8cdb2a).
⚠️ Report is 174 commits behind head on main.

Files with missing lines Patch % Lines
command.go 0.00% 22 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #519      +/-   ##
==========================================
- Coverage   87.28%   85.75%   -1.53%     
==========================================
  Files          33       34       +1     
  Lines         928      983      +55     
==========================================
+ Hits          810      843      +33     
- Misses         94      116      +22     
  Partials       24       24              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread csv_page_result.go
buf.WriteString(`"Page URL","Link URL",Status` + "\n")

for _, link := range r.Links {
buf.WriteString(`"` + strings.ReplaceAll(r.URL, `"`, `""`) + `","` +

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.

Can we use the encoding/csv package?

@stelgenhof stelgenhof Jun 18, 2025

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I wanted to be accurate and ensure that string fields are always quoted, since URL's technically can have comma's (as per RFC 3986). For example in the query string. My first attempt was actually using the encode/csv package, however read somewhere that it doesn't quote by default or otherwise quote every field, so opted for this approach.

However, after some more reading, I think my understanding may have been wrong and can actually use the encoding/csv instead. I'll do some refactoring 😄

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.

Feature request: Export/Results as CSV

2 participants