@@ -80,6 +80,10 @@ function renderWarnings(warnings: string[]): string {
8080 return [ "## ⚠️ Warnings" , blocks . join ( "\n\n" ) ] . join ( "\n" ) ;
8181}
8282
83+ function countFileChanges ( status : ScopeTotals [ "status" ] ) : number {
84+ return status . added + status . modified + status . renamed + status . removed + status . other ;
85+ }
86+
8387/**
8488 * Render a single table combining change summary and per-scope breakdown.
8589 */
@@ -100,14 +104,14 @@ function renderChangeTable(summary: ScopeReport): string {
100104
101105 const scopeHasChange = ( totals : ScopeTotals ) : boolean => {
102106 const churn = totals . additions + totals . deletions ;
103- const fileDelta = totals . status . added + totals . status . modified + totals . status . renamed - totals . status . removed ;
107+ const fileDelta = countFileChanges ( totals . status ) ;
104108 return churn !== 0 || fileDelta !== 0 ;
105109 } ;
106110
107111 const scopeRows = sortedScopes . filter ( ( scope ) => scopeHasChange ( summary . totals [ scope ] ) ) . map ( ( scope ) => {
108112 const scoped : ScopeTotals = summary . totals [ scope ] ;
109113 const s = scoped . status ;
110- const fileDelta = s . added + s . modified + s . renamed - s . removed ;
114+ const fileDelta = countFileChanges ( s ) ;
111115 const churn = scoped . additions + scoped . deletions ;
112116 const fileDeltaBold = formatCount ( fileDelta ) ; // bold delta
113117 const label = labelForScope ( scope ) ;
@@ -127,7 +131,7 @@ function renderChangeTable(summary: ScopeReport): string {
127131 const total = summary . overall ;
128132 const totalStatus = total . status ;
129133 const totalChurn = total . additions + total . deletions ;
130- const totalFileDelta = totalStatus . added + totalStatus . modified + totalStatus . renamed - totalStatus . removed ;
134+ const totalFileDelta = countFileChanges ( totalStatus ) ;
131135 const totalRow = [
132136 "**Total**" ,
133137 formatCount ( totalChurn ) ,
0 commit comments