diff --git a/src/utils.ts b/src/utils.ts index e0b661e..ac1631e 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -261,7 +261,9 @@ export async function getSourceUnits(rootPath: string, contractsDirectories: str includePath: [rootPath], }); - const sourceUnits = new ASTReader().read(compiledFiles.data, ASTKind.Any, compiledFiles.files); + const sourceUnits = new ASTReader().read(compiledFiles.data, ASTKind.Any, compiledFiles.files) + // Skip source units that are not in the contracts directories + .filter((sourceUnit) => contractsDirectories.some((directory) => sourceUnit.absolutePath.includes(directory))); return sourceUnits; }