fix(ci): атомарно печатать отчёт private-writes (#645)

Linux CI при параллельном npm test мог потерять последнюю отдельную запись
stdout после длинной таблицы --count. Формируем отчёт целиком и пишем его
одним вызовом, чтобы итоговая строка всегда доходила до unit-теста.

Issue: #645
User-Visible: no
This commit is contained in:
Sergey Matyunin
2026-09-25 08:58:05 +03:00
parent 23e55d4929
commit a8437e69e5
+5 -4
View File
@@ -289,10 +289,11 @@ function main(argv) {
const byFile = countWrites(ROOT);
const writes = byFile.reduce((sum, f) => sum + f.writes, 0);
const calls = byFile.reduce((sum, f) => sum + f.calls, 0);
for (const f of byFile.sort((a, b) => b.writes - a.writes || a.path.localeCompare(b.path))) {
console.log(`${String(f.writes).padStart(5)} ${String(f.calls).padStart(5)} ${f.path}`);
}
console.log(`Итого: записей ${writes}, покрытых фасадом вызовов ${calls} в ${byFile.length} файл(ах).`);
const lines = byFile
.sort((a, b) => b.writes - a.writes || a.path.localeCompare(b.path))
.map((f) => `${String(f.writes).padStart(5)} ${String(f.calls).padStart(5)} ${f.path}`);
lines.push(`Итого: записей ${writes}, покрытых фасадом вызовов ${calls} в ${byFile.length} файл(ах).`);
process.stdout.write(`${lines.join('\n')}\n`);
return 0;
}