Skip to content

[BUG]: CSV exports produce malformed files when fields contain commas or quotes #245

Description

@Dotify71

Problem Description

Currently, exportReposCSV, exportContributorsCSV, and exportTrendsCSV format CSV rows by directly calling .join(','). If exported data fields (such as repository names, descriptions, or organization logins) contain commas, double quotes, or newlines, the resulting CSV file has corrupted column alignment when opened in Excel, Google Sheets, or standard CSV parsers.

Steps to Reproduce

  1. Go to Repositories, Contributors, or Trends page.
  2. Click the CSV Export button on data containing fields with commas or quotes.
  3. Open the downloaded .csv file in Excel / Google Sheets.
  4. Observe broken columns and misplaced cell data.

Expected Behavior

CSV exports should adhere to RFC 4180 standards:

  • Enclose cells containing commas, double quotes, or newlines in double quotes ("...").
  • Escape internal double quotes by doubling them ("").

Activity

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions