From bebc5d847d126a83f010464b58e41b23811a94d4 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 21 Jun 2026 22:34:22 +0200 Subject: [PATCH] fix(scripts): reject short flag CI timing limits --- scripts/ci-run-timings.mjs | 2 +- test/scripts/ci-run-timings.test.ts | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/ci-run-timings.mjs b/scripts/ci-run-timings.mjs index 6cec3e244c13..6b0f51879930 100644 --- a/scripts/ci-run-timings.mjs +++ b/scripts/ci-run-timings.mjs @@ -416,7 +416,7 @@ function consumePositiveIntFlag(args, index, flag) { return null; } const rawValue = args[index + 1]; - if (!rawValue || rawValue.startsWith("--")) { + if (!rawValue || rawValue.startsWith("-")) { throw new Error(`${flag} requires a value`); } return { diff --git a/test/scripts/ci-run-timings.test.ts b/test/scripts/ci-run-timings.test.ts index 73c0c5ba0ea7..bcefa86f646e 100644 --- a/test/scripts/ci-run-timings.test.ts +++ b/test/scripts/ci-run-timings.test.ts @@ -263,7 +263,13 @@ describe("scripts/ci-run-timings.mjs", () => { }); it("rejects missing monitor limits instead of treating flags as values", () => { - for (const args of [["--limit"], ["--limit", "--recent", "4"], ["--recent"]]) { + for (const args of [ + ["--limit"], + ["--limit", "--recent", "4"], + ["--limit", "-h"], + ["--recent"], + ["--recent", "-h"], + ]) { expect(() => parseRunTimingArgs(args)).toThrow("requires a value"); } });