Skip to content

Commit 0342758

Browse files
committed
Update check.ts
1 parent c1605af commit 0342758

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

check.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { WalkEntry } from "https://deno.land/[email protected]/fs/_util.ts";
66
function searchFilesNames({
77
skip,
88
}: // limiter,
9-
{
10-
skip?: RegExp | RegExp[];
11-
// limiter: AsyncCurrentLimiter;
12-
}) {
9+
{
10+
skip?: RegExp | RegExp[];
11+
// limiter: AsyncCurrentLimiter;
12+
}) {
1313
console.log("type check start!");
1414

1515
const entry_iter = walk(".", {
@@ -27,19 +27,17 @@ if (import.meta.main) {
2727

2828
async function parallel_check(
2929
entry_iter: AsyncIterableIterator<WalkEntry>,
30-
limiter: AsyncCurrentLimiter,
30+
limiter: AsyncCurrentLimiter
3131
) {
3232
const stack: string[] = [];
3333

3434
const ps: Array<Promise<void>> = [];
3535
for await (const entry of entry_iter) {
36-
console.log(entry.path);
3736
if (stack.length < 15) {
3837
stack.push(entry.path);
3938
} else {
4039
ps.push(limiter.run(() => runDenoCheck([...stack, entry.path])));
4140
stack.length = 0;
42-
// console.log({ status, stdout, stderr });
4341
}
4442
}
4543
if (stack.length) {
@@ -52,18 +50,20 @@ async function start() {
5250
const limiter = new AsyncLimiterClass(navigator.hardwareConcurrency);
5351
const args = parse(Deno.args);
5452
console.log(args);
55-
const skip = typeof args.skip === "string"
56-
? new RegExp(String(args.skip))
57-
: Array.isArray(args.skip)
58-
? args.skip.map((s) => new RegExp(s))
59-
: undefined;
53+
const skip =
54+
typeof args.skip === "string"
55+
? new RegExp(String(args.skip))
56+
: Array.isArray(args.skip)
57+
? args.skip.map((s) => new RegExp(s))
58+
: undefined;
6059
const entry_iter = searchFilesNames({ skip });
6160
await parallel_check(entry_iter, limiter);
6261
console.log("type check Done!");
6362
}
6463

6564
async function runDenoCheck(stack: string[]) {
6665
const cmd = ["deno", "check", "--unstable", ...stack];
66+
console.log(cmd);
6767
const process = Deno.run({
6868
cmd: cmd,
6969
stderr: "piped",
@@ -77,7 +77,7 @@ async function runDenoCheck(stack: string[]) {
7777
const decoder = new TextDecoder();
7878
const out = decoder.decode(stdout);
7979
const err = decoder.decode(stderr);
80-
console.log(cmd, status, out, err);
80+
console.log(status, out, err);
8181
process.close();
8282
if (!status.success) {
8383
throw new Error("type check failed:" + out + err);

0 commit comments

Comments
 (0)