From c3cbfc22e015a51dde17951c9e0a9a86a2afcc5c Mon Sep 17 00:00:00 2001 From: Paul Gschwendtner Date: Sun, 23 May 2021 19:15:14 +0200 Subject: [PATCH] fix(dev-infra): format command incorrectly prints outdated files (#42252) When `ng-dev format --check` is run, the ng-dev tool prints out all files that are out-of-date. We recently updated the format tool to also capture `stderr` for failed files. This broke the console message as we did not unwrap the `FormatFailure` to their file path when printing the "ng-dev format" fix command. PR Close #42252 --- dev-infra/format/format.ts | 2 +- dev-infra/ng-dev.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-infra/format/format.ts b/dev-infra/format/format.ts index 7f05348148..50e458503d 100644 --- a/dev-infra/format/format.ts +++ b/dev-infra/format/format.ts @@ -70,7 +70,7 @@ export async function checkFiles(files: string[]) { // Inform user how to format files in the future. info(); info(`To format the failing file run the following command:`); - info(` yarn ng-dev format files ${failures.join(' ')}`); + info(` yarn ng-dev format files ${failures.map(f => f.filePath).join(' ')}`); process.exit(1); } } else { diff --git a/dev-infra/ng-dev.js b/dev-infra/ng-dev.js index ad96619fc7..22f0a35bc3 100755 --- a/dev-infra/ng-dev.js +++ b/dev-infra/ng-dev.js @@ -2683,7 +2683,7 @@ function checkFiles(files) { // Inform user how to format files in the future. info(); info(`To format the failing file run the following command:`); - info(` yarn ng-dev format files ${failures.join(' ')}`); + info(` yarn ng-dev format files ${failures.map(f => f.filePath).join(' ')}`); process.exit(1); } }