Skip to content

Commit

Permalink
fix(utils): unchanged categories table markdown content
Browse files Browse the repository at this point in the history
  • Loading branch information
matejchalk committed Jul 8, 2024
1 parent 3d73dea commit 1df3ccb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

## 🏷️ Categories

|🏷️ Category|Previous score|
|🏷️ Category|Score|
|:--|:--:|
|Performance||
|Bug prevention||
|Code style||
|Performance|🟢 92|
|Bug prevention|🟡 68|
|Code style|🟡 54|

## 🗃️ Groups

Expand Down
6 changes: 3 additions & 3 deletions packages/utils/src/lib/reports/generate-md-reports-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ function formatDiffCategoriesSection(diff: ReportsDiff): string {

const columns: TableColumnObject[] = [
{ key: 'category', label: '🏷️ Category', align: 'left' },
{ key: 'before', label: '⭐ Previous score' },
{ key: 'after', label: hasChanges ? '⭐ Current score' : '⭐ Score' },
{ key: 'before', label: hasChanges ? '⭐ Previous score' : '⭐ Score' },
{ key: 'after', label: '⭐ Current score' },
{ key: 'change', label: '🔄 Score change' },
];
return lines(
Expand Down Expand Up @@ -111,7 +111,7 @@ function formatDiffCategoriesSection(diff: ReportsDiff): string {
change: '–',
})),
].map(row =>
hasChanges ? row : { category: row.category, after: row.after },
hasChanges ? row : { category: row.category, before: row.before },
),
}),
added.length > 0 && section(italicMd('(\\*) New category.')),
Expand Down

0 comments on commit 1df3ccb

Please sign in to comment.