refactor(ci): share duplication report clone-file schema (#16384)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-03 14:59:27 +00:00
1 parent d470cc88b6
commit bfe132cc01
1 file changed
+13 -23
+13 -23
View File
@@ -26,29 +26,19 @@ const lintReport = z.object({
}),
),
});
const duplicateReport = z
.object({
duplicates: z.array(
z
.object({
firstFile: z.object({ name: z.string() }).passthrough(),
secondFile: z.object({ name: z.string() }).passthrough(),
})
.passthrough(),
),
statistics: z
.object({
total: z
.object({
sources: z.number(),
clones: z.number(),
percentage: z.number(),
})
.passthrough(),
})
.passthrough(),
})
.passthrough();
const cloneFile = z.looseObject({ name: z.string() });
const duplicateReport = z.looseObject({
duplicates: z.array(
z.looseObject({ firstFile: cloneFile, secondFile: cloneFile }),
),
statistics: z.looseObject({
total: z.looseObject({
sources: z.number(),
clones: z.number(),
percentage: z.number(),
}),
}),
});
const run = (
packageName,