mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-24 08:03:19 +00:00
Benchmark verdicts could pass with selected workloads or required metrics missing, empty or non-finite, and pnpm perf:rust could accept stale or partial criterion results. Selections and counts are now validated before any work starts, every selected workload must report finite values for its required metrics, and Rust results are collected only for the selected packages from fresh, well-formed criterion artifacts, against a list of the benchmarks each package owns. Co-authored-by: Mr0Bread <55754540+Mr0Bread@users.noreply.github.com>
9 lines
354 B
TypeScript
9 lines
354 B
TypeScript
/** CLI repetition counts must be validated before any build or process launch. */
|
|
export function countOption(name: string, raw: string, minimum: 0 | 1): number {
|
|
const value = Number(raw);
|
|
if (!raw.trim() || !Number.isSafeInteger(value) || value < minimum) {
|
|
throw new Error(`--${name} must be an integer >= ${minimum}`);
|
|
}
|
|
return value;
|
|
}
|