From ebb670b2086356606eadd74c75cb98687774604d Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Sun, 21 Jun 2026 21:18:48 +0200 Subject: [PATCH] fix(scripts): reject short flag gauntlet values --- scripts/check-plugin-gateway-gauntlet.mjs | 2 +- test/scripts/plugin-gateway-gauntlet.test.ts | 25 ++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/scripts/check-plugin-gateway-gauntlet.mjs b/scripts/check-plugin-gateway-gauntlet.mjs index 2482f2686c3b..8c626bdf49cf 100644 --- a/scripts/check-plugin-gateway-gauntlet.mjs +++ b/scripts/check-plugin-gateway-gauntlet.mjs @@ -82,7 +82,7 @@ export function parseArgs(argv) { const arg = args[index]; const readValue = () => { const value = args[index + 1]; - if (!value || value.startsWith("--")) { + if (!value || value.startsWith("-")) { throw new Error(`Missing value for ${arg}`); } index += 1; diff --git a/test/scripts/plugin-gateway-gauntlet.test.ts b/test/scripts/plugin-gateway-gauntlet.test.ts index ca61364068be..906c8b22dbfd 100644 --- a/test/scripts/plugin-gateway-gauntlet.test.ts +++ b/test/scripts/plugin-gateway-gauntlet.test.ts @@ -132,8 +132,29 @@ describe("plugin gateway gauntlet helpers", () => { }); it("rejects valued flags followed by another option", () => { - for (const flag of ["--repo-root", "--output-dir", "--plugin", "--qa-scenario"]) { - expect(() => parseArgs([flag, "--skip-qa"])).toThrow(`Missing value for ${flag}`); + for (const flag of [ + "--repo-root", + "--output-dir", + "--plugin", + "--shard-total", + "--shard-index", + "--limit", + "--qa-scenario", + "--qa-plugin-chunk-size", + "--cpu-core-warn", + "--hot-wall-warn-ms", + "--max-rss-warn-mb", + "--wall-anomaly-multiplier", + "--rss-anomaly-multiplier", + "--qa-cpu-regression-multiplier", + "--qa-wall-regression-multiplier", + "--command-timeout-ms", + "--build-timeout-ms", + "--qa-timeout-ms", + ]) { + for (const value of ["--skip-qa", "-h"]) { + expect(() => parseArgs([flag, value])).toThrow(`Missing value for ${flag}`); + } } });