Skip to content

Commit

Permalink
feat: set excluded functions from env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Odonno committed Sep 16, 2024
1 parent 41c293c commit 1e78232
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,13 @@ jobs:
working-directory: ./scripts
- run: bun run index.ts
working-directory: ./scripts
env:
EXCLUDED_FUNCS: |
.chain
NOT_IMPLEMENTED_FUNCS: |
string::distance::hamming
string::distance::levenshtein
string::similarity::jaro
vector::distance::mahalanobis
vector::similarity::spearman
10 changes: 8 additions & 2 deletions scripts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ const repositoryName = "surrealdb/surrealdb";
const branch = "main";
const fncSourceCodeFilePath = "core/src/fnc/mod.rs";

const fncExclusions = [".chain"];
const fncExclusions = Bun.env.EXCLUDED_FUNCS
? Bun.env.EXCLUDED_FUNCS.split("\n")
: [];
const fncNotImplemented = Bun.env.NOT_IMPLEMENTED_FUNCS
? Bun.env.NOT_IMPLEMENTED_FUNCS.split("\n")
: [];

const detectMissingFunctions = async () => {
console.log("Detecting missing functions...");
Expand Down Expand Up @@ -85,7 +90,8 @@ const detectMissingFunctions = async () => {
.replace(/\u200B/g, "")
)
.get()
.filter((functionName) => !fncExclusions.includes(functionName));
.filter((functionName) => !fncExclusions.includes(functionName))
.filter((functionName) => !fncNotImplemented.includes(functionName));

allDocumentedFunctions.push(...functionNames);
}
Expand Down

0 comments on commit 1e78232

Please sign in to comment.