Spaces:
Runtime error
Runtime error
Uanderson Silva commited on
Commit ·
b66ebf4
1
Parent(s): 10be466
remove tests and remappings from scope
Browse files
src/agents/auditor/agent.ts
CHANGED
|
@@ -18,6 +18,7 @@ import {
|
|
| 18 |
MAX_SOL_CHARS,
|
| 19 |
SKIP_DIRS,
|
| 20 |
SOL_EXT,
|
|
|
|
| 21 |
} from "./config.ts";
|
| 22 |
|
| 23 |
const walkDirectory = (dir: string, depth: number, solFiles: string[], docFiles: string[]) => {
|
|
@@ -41,7 +42,8 @@ const walkDirectory = (dir: string, depth: number, solFiles: string[], docFiles:
|
|
| 41 |
const base = path.basename(entry.name, ext).toLowerCase();
|
| 42 |
|
| 43 |
if (ext === SOL_EXT) {
|
| 44 |
-
|
|
|
|
| 45 |
} else if (DOC_EXTS.has(ext) || DOC_BASENAMES.has(base)) {
|
| 46 |
docFiles.push(fullPath);
|
| 47 |
}
|
|
|
|
| 18 |
MAX_SOL_CHARS,
|
| 19 |
SKIP_DIRS,
|
| 20 |
SOL_EXT,
|
| 21 |
+
SOL_TEST_SUFFIXES,
|
| 22 |
} from "./config.ts";
|
| 23 |
|
| 24 |
const walkDirectory = (dir: string, depth: number, solFiles: string[], docFiles: string[]) => {
|
|
|
|
| 42 |
const base = path.basename(entry.name, ext).toLowerCase();
|
| 43 |
|
| 44 |
if (ext === SOL_EXT) {
|
| 45 |
+
const isTest = SOL_TEST_SUFFIXES.some((suffix) => entry.name.endsWith(suffix));
|
| 46 |
+
if (!isTest) solFiles.push(fullPath);
|
| 47 |
} else if (DOC_EXTS.has(ext) || DOC_BASENAMES.has(base)) {
|
| 48 |
docFiles.push(fullPath);
|
| 49 |
}
|
src/agents/auditor/config.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
export const SOL_EXT = ".sol";
|
| 2 |
-
export const
|
|
|
|
| 3 |
export const DOC_BASENAMES = new Set(["readme", "whitepaper", "spec", "architecture", "design", "overview", "docs"]);
|
| 4 |
export const SKIP_DIRS = new Set([
|
| 5 |
"node_modules",
|
|
@@ -11,6 +12,10 @@ export const SKIP_DIRS = new Set([
|
|
| 11 |
".deps",
|
| 12 |
"build",
|
| 13 |
"dist",
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
]);
|
| 15 |
export const MAX_DEPTH = 6;
|
| 16 |
export const MAX_DOC_CHARS = 12_000;
|
|
|
|
| 1 |
export const SOL_EXT = ".sol";
|
| 2 |
+
export const SOL_TEST_SUFFIXES = [".t.sol", ".test.sol", ".spec.sol"];
|
| 3 |
+
export const DOC_EXTS = new Set([".md", ".rst", ".adoc"]);
|
| 4 |
export const DOC_BASENAMES = new Set(["readme", "whitepaper", "spec", "architecture", "design", "overview", "docs"]);
|
| 5 |
export const SKIP_DIRS = new Set([
|
| 6 |
"node_modules",
|
|
|
|
| 12 |
".deps",
|
| 13 |
"build",
|
| 14 |
"dist",
|
| 15 |
+
"test",
|
| 16 |
+
"tests",
|
| 17 |
+
"script",
|
| 18 |
+
"scripts",
|
| 19 |
]);
|
| 20 |
export const MAX_DEPTH = 6;
|
| 21 |
export const MAX_DOC_CHARS = 12_000;
|