From ac0d53242fbc45b0f1321a9ee49e15bd1bd6d395 Mon Sep 17 00:00:00 2001 From: T Savo Date: Wed, 8 Apr 2026 15:10:30 -0700 Subject: [PATCH] fix(scripts): apply prettier --write to benchmark-sandbox-image-build.js MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `scripts/benchmark-sandbox-image-build.js` had line-length drift between the source and the project's prettier config. `npx prettier --check` would warn on it, and the prek pre-push hook auto-fixed it on every contributor's machine — which then triggered the framework's "Files were modified by following hooks" failure path, blocking the push for any contributor whose own diff was unrelated. This is the residual fix for #1636 after #1634 already cleaned up the ESLint and prettier drift in `bin/lib/onboard.js` and `test/onboard.test.js`. The benchmark script wasn't covered by #1634's sweep, so it's still the last file failing `prettier --check` on stock `main`. `prettier --write` produced a handful of `execFileSync(...)` and `run(...)` argument wraps. No semantic change — same calls, same args, same control flow, just line-broken to comply with the configured max width. Refs #1636. Signed-off-by: T Savo --- scripts/benchmark-sandbox-image-build.js | 32 +++++++++++++++++++----- 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/scripts/benchmark-sandbox-image-build.js b/scripts/benchmark-sandbox-image-build.js index 23036266b..6d7dbd712 100755 --- a/scripts/benchmark-sandbox-image-build.js +++ b/scripts/benchmark-sandbox-image-build.js @@ -72,7 +72,9 @@ function dockerBuild(repoRoot, stageFn, label, noCache) { try { run("docker", args); const elapsedSeconds = Number(process.hrtime.bigint() - startedAt) / 1e9; - const imageBytes = Number(run("docker", ["image", "inspect", imageTag, "--format", "{{.Size}}"])); + const imageBytes = Number( + run("docker", ["image", "inspect", imageTag, "--format", "{{.Size}}"]), + ); return { label, buildCtx, @@ -122,16 +124,34 @@ function printSummary(results) { function main() { const args = parseArgs(process.argv.slice(2)); const currentRepo = path.resolve(args.currentRepo); - const currentHead = execFileSync("git", ["rev-parse", "--short", "HEAD"], { cwd: currentRepo, encoding: "utf8" }).trim(); - const currentDirty = execFileSync("git", ["status", "--short"], { cwd: currentRepo, encoding: "utf8" }).trim().length > 0; + const currentHead = execFileSync("git", ["rev-parse", "--short", "HEAD"], { + cwd: currentRepo, + encoding: "utf8", + }).trim(); + const currentDirty = + execFileSync("git", ["status", "--short"], { cwd: currentRepo, encoding: "utf8" }).trim() + .length > 0; const currentLabel = currentDirty ? `${currentHead} + dirty` : currentHead; const mainWorktree = makeTempWorktree(args.mainRef, currentRepo); try { - const mainLabel = execFileSync("git", ["rev-parse", "--short", "HEAD"], { cwd: mainWorktree, encoding: "utf8" }).trim(); + const mainLabel = execFileSync("git", ["rev-parse", "--short", "HEAD"], { + cwd: mainWorktree, + encoding: "utf8", + }).trim(); const results = [ - dockerBuild(mainWorktree, stageLegacySandboxBuildContext, `main (${mainLabel})`, args.noCache), - dockerBuild(currentRepo, stageOptimizedSandboxBuildContext, `candidate (${currentLabel})`, args.noCache), + dockerBuild( + mainWorktree, + stageLegacySandboxBuildContext, + `main (${mainLabel})`, + args.noCache, + ), + dockerBuild( + currentRepo, + stageOptimizedSandboxBuildContext, + `candidate (${currentLabel})`, + args.noCache, + ), ]; printSummary(results); } finally {