mirror of
https://github.com/denoland/deno.git
synced 2024-12-22 23:34:47 -05:00
chore: clean up lint script (#20682)
Right now, if one of the linters fails, the all other ones continue running in the background. This fixes this by waiting until all linters are done before settling.
This commit is contained in:
parent
939279aa10
commit
6f87962a77
1 changed files with 23 additions and 15 deletions
|
@ -3,26 +3,34 @@
|
||||||
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
|
import { buildMode, getPrebuilt, getSources, join, ROOT_PATH } from "./util.js";
|
||||||
import { checkCopyright } from "./copyright_checker.js";
|
import { checkCopyright } from "./copyright_checker.js";
|
||||||
|
|
||||||
let didLint = false;
|
const promises = [];
|
||||||
|
|
||||||
if (Deno.args.includes("--js")) {
|
let js = Deno.args.includes("--js");
|
||||||
await dlint();
|
let rs = Deno.args.includes("--rs");
|
||||||
await dlintPreferPrimordials();
|
if (!js && !rs) {
|
||||||
didLint = true;
|
js = true;
|
||||||
|
rs = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Deno.args.includes("--rs")) {
|
if (js) {
|
||||||
await clippy();
|
promises.push(dlint());
|
||||||
didLint = true;
|
promises.push(dlintPreferPrimordials());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!didLint) {
|
if (rs) {
|
||||||
await Promise.all([
|
promises.push(clippy());
|
||||||
dlint(),
|
}
|
||||||
dlintPreferPrimordials(),
|
|
||||||
checkCopyright(),
|
if (!js && !rs) {
|
||||||
clippy(),
|
promises.push(checkCopyright());
|
||||||
]);
|
}
|
||||||
|
|
||||||
|
const results = await Promise.allSettled(promises);
|
||||||
|
for (const result of results) {
|
||||||
|
if (result.status === "rejected") {
|
||||||
|
console.error(result.reason);
|
||||||
|
Deno.exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function dlint() {
|
async function dlint() {
|
||||||
|
|
Loading…
Reference in a new issue