File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -52,16 +52,18 @@ export {
5252export { logMultipleResults } from './lib/log-results' ;
5353export { link } from './lib/logging' ;
5454export { ProgressBar , getProgressBar } from './lib/progress' ;
55- export { TERMINAL_WIDTH } from './lib/reports/constants' ;
55+ export {
56+ CODE_PUSHUP_DOMAIN ,
57+ FOOTER_PREFIX ,
58+ README_LINK ,
59+ TERMINAL_WIDTH ,
60+ } from './lib/reports/constants' ;
5661export { generateMdReport } from './lib/reports/generate-md-report' ;
5762export { generateStdoutSummary } from './lib/reports/generate-stdout-summary' ;
5863export { scoreReport } from './lib/reports/scoring' ;
5964export { sortReport } from './lib/reports/sorting' ;
6065export { ScoredReport } from './lib/reports/types' ;
6166export {
62- CODE_PUSHUP_DOMAIN ,
63- FOOTER_PREFIX ,
64- README_LINK ,
6567 calcDuration ,
6668 compareIssueSeverity ,
6769 loadReport ,
Original file line number Diff line number Diff line change @@ -8,3 +8,39 @@ export const SCORE_COLOR_RANGE = {
88 YELLOW_MIN : 0.5 ,
99} ;
1010/* eslint-enable no-magic-numbers */
11+
12+ export const FOOTER_PREFIX = 'Made with ❤ by' ; // replace ❤️ with ❤, because of ❤️ has output issues
13+ export const CODE_PUSHUP_DOMAIN = 'code-pushup.dev' ;
14+ export const README_LINK =
15+ 'https://github.com/flowup/quality-metrics-cli#readme' ;
16+ export const reportHeadlineText = 'Code PushUp Report' ;
17+ export const reportOverviewTableHeaders = [
18+ '🏷 Category' ,
19+ '⭐ Score' ,
20+ '🛡 Audits' ,
21+ ] ;
22+ export const reportRawOverviewTableHeaders = [ 'Category' , 'Score' , 'Audits' ] ;
23+ export const reportMetaTableHeaders : string [ ] = [
24+ 'Commit' ,
25+ 'Version' ,
26+ 'Duration' ,
27+ 'Plugins' ,
28+ 'Categories' ,
29+ 'Audits' ,
30+ ] ;
31+
32+ export const pluginMetaTableHeaders : string [ ] = [
33+ 'Plugin' ,
34+ 'Audits' ,
35+ 'Version' ,
36+ 'Duration' ,
37+ ] ;
38+
39+ // details headers
40+
41+ export const detailsTableHeaders : string [ ] = [
42+ 'Severity' ,
43+ 'Message' ,
44+ 'Source file' ,
45+ 'Line(s)' ,
46+ ] ;
Original file line number Diff line number Diff line change 11import { AuditReport , CategoryConfig , Issue } from '@code-pushup/models' ;
22import { formatDate , formatDuration , slugify } from '../formatting' ;
33import { CommitData } from '../git' ;
4- import { NEW_LINE } from './constants' ;
4+ import {
5+ FOOTER_PREFIX ,
6+ NEW_LINE ,
7+ README_LINK ,
8+ detailsTableHeaders ,
9+ pluginMetaTableHeaders ,
10+ reportHeadlineText ,
11+ reportMetaTableHeaders ,
12+ reportOverviewTableHeaders ,
13+ } from './constants' ;
514import {
615 details ,
716 h2 ,
@@ -15,21 +24,14 @@ import {
1524} from './md' ;
1625import { ScoredGroup , ScoredReport } from './types' ;
1726import {
18- FOOTER_PREFIX ,
19- README_LINK ,
2027 countCategoryAudits ,
21- detailsTableHeaders ,
2228 formatReportScore ,
2329 getPluginNameFromSlug ,
2430 getRoundScoreMarker ,
2531 getSeverityIcon ,
2632 getSortableAuditByRef ,
2733 getSortableGroupByRef ,
2834 getSquaredScoreMarker ,
29- pluginMetaTableHeaders ,
30- reportHeadlineText ,
31- reportMetaTableHeaders ,
32- reportOverviewTableHeaders ,
3335} from './utils' ;
3436
3537export function generateMdReport (
Original file line number Diff line number Diff line change 11import cliui from '@isaacs/cliui' ;
22import chalk from 'chalk' ;
33import CliTable3 from 'cli-table3' ;
4- import { NEW_LINE , SCORE_COLOR_RANGE , TERMINAL_WIDTH } from './constants' ;
5- import { ScoredReport } from './types' ;
64import {
75 CODE_PUSHUP_DOMAIN ,
86 FOOTER_PREFIX ,
9- countCategoryAudits ,
10- formatReportScore ,
7+ NEW_LINE ,
8+ SCORE_COLOR_RANGE ,
9+ TERMINAL_WIDTH ,
1110 reportHeadlineText ,
1211 reportRawOverviewTableHeaders ,
13- } from './utils' ;
12+ } from './constants' ;
13+ import { ScoredReport } from './types' ;
14+ import { countCategoryAudits , formatReportScore } from './utils' ;
1415
1516function addLine ( line = '' ) : string {
1617 return line + NEW_LINE ;
Original file line number Diff line number Diff line change @@ -18,42 +18,6 @@ import {
1818import { SCORE_COLOR_RANGE } from './constants' ;
1919import { ScoredReport , SortableAuditReport , SortableGroup } from './types' ;
2020
21- export const FOOTER_PREFIX = 'Made with ❤ by' ; // replace ❤️ with ❤, because of ❤️ has output issues
22- export const CODE_PUSHUP_DOMAIN = 'code-pushup.dev' ;
23- export const README_LINK =
24- 'https://github.com/flowup/quality-metrics-cli#readme' ;
25- export const reportHeadlineText = 'Code PushUp Report' ;
26- export const reportOverviewTableHeaders = [
27- '🏷 Category' ,
28- '⭐ Score' ,
29- '🛡 Audits' ,
30- ] ;
31- export const reportRawOverviewTableHeaders = [ 'Category' , 'Score' , 'Audits' ] ;
32- export const reportMetaTableHeaders : string [ ] = [
33- 'Commit' ,
34- 'Version' ,
35- 'Duration' ,
36- 'Plugins' ,
37- 'Categories' ,
38- 'Audits' ,
39- ] ;
40-
41- export const pluginMetaTableHeaders : string [ ] = [
42- 'Plugin' ,
43- 'Audits' ,
44- 'Version' ,
45- 'Duration' ,
46- ] ;
47-
48- // details headers
49-
50- export const detailsTableHeaders : string [ ] = [
51- 'Severity' ,
52- 'Message' ,
53- 'Source file' ,
54- 'Line(s)' ,
55- ] ;
56-
5721export function formatReportScore ( score : number ) : string {
5822 return Math . round ( score * 100 ) . toString ( ) ;
5923}
You can’t perform that action at this time.
0 commit comments