Depends on #15
Overview
Add support for custom delimiters in CSV output via the --csv-delimiter CLI flag.
Current Behavior
- CSV reporter always uses comma (
,) as the delimiter
- Delimiter is hardcoded in the CSVReporter constructor
Desired Behavior
- Users can specify custom delimiters via
--csv-delimiter <char> flag
- Common use cases:
- Semicolon (
;) for European locales
- Tab (
\t) for TSV format
- Pipe (
|) for specific processing needs
Implementation Steps
1. Update CLI Command Definition
File: src/cli/commands/run.ts
Add option to yargs configuration:
.option('csv-delimiter', {
alias: 'csv-delim',
description: 'Delimiter character for CSV output',
type: 'string',
default: ',',
})
2. Update Type Definitions
File: src/types/cli.ts or relevant types file
Add to RunCommandArgs interface:
3. Pass Delimiter to Reporter Registry
File: src/reporters/registry.ts or where reporters are instantiated
When creating CSV reporter, pass delimiter from CLI options:
case 'csv':
return new CsvReporter({
delimiter: options.csvDelimiter || ',',
outputPath: options.output,
quiet: options.quiet,
});
4. Update CSV Reporter
File: src/reporters/csv.ts
- Already supports
delimiter in constructor options ✅
- Ensure delimiter is used in
formatRow() method ✅
- No changes needed (already implemented!)
5. Update Tests
File: test/integration/reporters.test.ts
- Un-skip the test at line 317
- Verify test passes with custom delimiter
- Add additional test cases for common delimiters (tab, pipe)
6. Update Documentation
Files to update:
README.md - Add --csv-delimiter to CLI options
ARCHITECTURE.md - Document reporter configuration options
- Examples directory - Add example using custom delimiter
Testing Checklist
Edge Cases to Consider
- What if delimiter is the same as the quote character?
- Should we support multi-character delimiters?
- Validate delimiter doesn't contain newlines or invalid characters
- How to specify tab character on command line? (
\t vs literal tab)
Estimated Complexity
Low - Most infrastructure already exists, mainly CLI plumbing needed.
Related Files
src/cli/commands/run.ts
src/reporters/csv.ts
src/reporters/registry.ts
test/integration/reporters.test.ts
Depends on #15
Overview
Add support for custom delimiters in CSV output via the
--csv-delimiterCLI flag.Current Behavior
,) as the delimiterDesired Behavior
--csv-delimiter <char>flag;) for European locales\t) for TSV format|) for specific processing needsImplementation Steps
1. Update CLI Command Definition
File:
src/cli/commands/run.tsAdd option to yargs configuration:
2. Update Type Definitions
File:
src/types/cli.tsor relevant types fileAdd to RunCommandArgs interface:
3. Pass Delimiter to Reporter Registry
File:
src/reporters/registry.tsor where reporters are instantiatedWhen creating CSV reporter, pass delimiter from CLI options:
4. Update CSV Reporter
File:
src/reporters/csv.tsdelimiterin constructor options ✅formatRow()method ✅5. Update Tests
File:
test/integration/reporters.test.ts6. Update Documentation
Files to update:
README.md- Add--csv-delimiterto CLI optionsARCHITECTURE.md- Document reporter configuration optionsTesting Checklist
--csv-delimiterflag--outputdirectory optionEdge Cases to Consider
\tvs literal tab)Estimated Complexity
Low - Most infrastructure already exists, mainly CLI plumbing needed.
Related Files
src/cli/commands/run.tssrc/reporters/csv.tssrc/reporters/registry.tstest/integration/reporters.test.ts