summaryrefslogtreecommitdiff
path: root/tools/copyright_checker.js
diff options
context:
space:
mode:
authorDavid Sherret <dsherret@users.noreply.github.com>2023-03-15 22:39:40 -0400
committerGitHub <noreply@github.com>2023-03-15 22:39:40 -0400
commit6c05b776e0c87ca825750ee67259c33a3ce10d0b (patch)
tree7f63dd77e110a6c42e68057e6bf931a5240cf83d /tools/copyright_checker.js
parent82ee73d795eb0d1c9b3ee226f069388b806a19b9 (diff)
chore: parallelize lint steps (#18214)
Diffstat (limited to 'tools/copyright_checker.js')
-rw-r--r--tools/copyright_checker.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/tools/copyright_checker.js b/tools/copyright_checker.js
index 6017e25c4..cdd11bcb3 100644
--- a/tools/copyright_checker.js
+++ b/tools/copyright_checker.js
@@ -40,7 +40,7 @@ export async function checkCopyright() {
"*Cargo.toml",
]);
- let totalCount = 0;
+ const errors = [];
const sourceFilesSet = new Set(sourceFiles);
for (const file of sourceFilesSet) {
@@ -53,8 +53,7 @@ export async function checkCopyright() {
"# Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.",
)
) {
- console.log(ERROR_MSG + file);
- totalCount += 1;
+ errors.push(ERROR_MSG + file);
}
continue;
}
@@ -65,12 +64,14 @@ export async function checkCopyright() {
"// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.",
)
) {
- console.log(ERROR_MSG + file);
- totalCount += 1;
+ errors.push(ERROR_MSG + file);
}
}
- if (totalCount > 0) {
+ if (errors.length > 0) {
+ // show all the errors at the same time to prevent overlap with
+ // other running scripts that may be outputting
+ console.error(errors.join("\n"));
throw new Error(`Copyright checker had ${totalCount} errors.`);
}
}