test(linter/plugins): print percentages in conformance tester report summary#16781
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
The new % column is a useful improvement, but formatPercent() currently divides by zero when total === 0, producing NaN% and potentially breaking reports/snapshots for edge cases. The table alignment logic also hard-codes padding widths, which is somewhat brittle if percent formatting or inputs change.
Additional notes (1)
- Maintainability |
apps/oxlint/conformance/src/report.ts:99-101
countAndPercent()hard-codes padding widths (padStart(5)andpadStart(6)) while the table header is| % |(6 chars including spaces). This will misalign if percentages ever exceed 100.0% (possible ifcount > totaldue to data issues) or if formatting changes (e.g.,100.00%). Consider making the widths named constants or deriving them from expected formats to avoid fragile alignment logic embedded in string concatenation.
Summary of changes
What changed
- Updated the conformance report summary tables to include a new percentage (
%) column for both Rules and Tests. - Replaced the previous
pad5()helper with a newcountAndPercent()helper that formats both the padded count and a padded percent string. - Refactored
formatProportion()to reuse a newformatPercent()helper. - Updated the snapshot (
apps/oxlint/conformance/snapshot.md) to match the new report output, including aligned percent values like100.0%,73.4%, etc.
There was a problem hiding this comment.
Pull request overview
This PR enhances the conformance tester report by adding percentage columns to the summary tables, providing better visibility into test coverage and success rates at a glance. The change extracts percentage calculation logic into a reusable function and updates both the Rules and Tests summary tables to display percentages alongside counts.
Key Changes
- Introduced
formatPercentfunction to calculate and format percentages - Refactored
formatProportionto use the newformatPercentfunction for consistency - Added percentage columns to both Rules and Tests summary tables
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| apps/oxlint/conformance/src/report.ts | Adds formatPercent helper function, creates countAndPercent helper for table formatting, refactors formatProportion to use formatPercent, and updates summary table headers and rows to include percentage columns |
| apps/oxlint/conformance/snapshot.md | Updates snapshot with expected output showing percentage columns in both Rules and Tests summary tables |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Merge activity
|
…summary (#16781) Include percentages in summaries at top of conformance tester report.
831fc57 to
1fde9b6
Compare
2bfa299 to
2124d03
Compare

Include percentages in summaries at top of conformance tester report.