mirror of
https://github.com/asg017/sqlite-vec.git
synced 2026-04-25 08:46:49 +02:00
make progress
This commit is contained in:
parent
e5b0f4c0c5
commit
a6b055ea39
2 changed files with 38 additions and 1 deletions
31
scripts/progress.ts
Normal file
31
scripts/progress.ts
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
const src = Deno.readTextFileSync("sqlite-vec.c");
|
||||
|
||||
function numOccuranges(rg) {
|
||||
return [...src.matchAll(rg)].length;
|
||||
}
|
||||
const numAsserts = numOccuranges(/todo_assert/g);
|
||||
const numComments = numOccuranges(/TODO/g);
|
||||
const numHandles = numOccuranges(/todo\(/g);
|
||||
|
||||
const realTodos = numOccuranges(/TODO\(/g);
|
||||
|
||||
const numTotal = numAsserts + numComments + numHandles - realTodos;
|
||||
|
||||
console.log("Number of todo_assert()'s: ", numAsserts);
|
||||
console.log('Number of "// TODO" comments: ', numComments);
|
||||
console.log("Number of todo panics: ", numHandles);
|
||||
console.log("Total TODOs: ", numTotal);
|
||||
|
||||
console.log();
|
||||
|
||||
const TOTAL = 246; // as of e5b0f4c0c5 (2024-04-20)
|
||||
const progress = (TOTAL - numTotal) / TOTAL;
|
||||
const width = 60;
|
||||
|
||||
console.log(
|
||||
"▓".repeat(progress * width) +
|
||||
"░".repeat((1 - progress) * width) +
|
||||
` (${numTotal - TOTAL}/${TOTAL})`
|
||||
);
|
||||
console.log();
|
||||
console.log(`${progress * 100.0}% complete to sqlite-vec v0`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue