From 0af4f22069d96ab5ae4ad5160eaa963ff82496e6 Mon Sep 17 00:00:00 2001 From: Fini Date: Sun, 24 May 2026 00:50:31 +0800 Subject: [PATCH] fix(ci): protect op-design-lint goldens from oxfmt + restore TS-oracle format CI 'Fail on golden drift' (rust-check.yml) was red because oxfmt inlined the 4-element padding arrays in the committed goldens, while the TS oracle's `JSON.stringify(value, null, 2)` emits them multi-line. Every `bun run format` would re-introduce the drift. Fix: - .prettierignore: ignore crates/op-design-lint/tests/fixtures/golden/ so oxfmt leaves them at the TS-oracle byte-exact format. - regenerate the two affected goldens via the oracle (edge-section-padding.json, stacked-horizontal-padding.json) so they match what the CI drift guard expects. `bun run tools/dump-diagnostics-golden.ts` + `git diff` now clean. `cargo test -p op-design-lint` 149/149 green. fmt-check clean. This was the only red workflow on the v0.8.0-new push; CI should be fully green after this lands. --- .prettierignore | 8 ++++++++ .../tests/fixtures/golden/edge-section-padding.json | 7 ++++++- .../tests/fixtures/golden/stacked-horizontal-padding.json | 7 ++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.prettierignore b/.prettierignore index b89bf460d..9d07b6019 100644 --- a/.prettierignore +++ b/.prettierignore @@ -15,6 +15,14 @@ target/ # Auto-generated by @tanstack/router-plugin. apps/web/src/routeTree.gen.ts +# op-design-lint TS-oracle parity goldens — regenerated by +# `tools/dump-diagnostics-golden.ts` via `JSON.stringify(value, null, 2)`, +# which keeps 4-element arrays multi-line. oxfmt's `printWidth: 100` +# inlines them, causing the CI drift guard (rust-check.yml: "Fail on +# golden drift") to red on every push. Keep these byte-identical to +# what the TS oracle emits. +crates/op-design-lint/tests/fixtures/golden/ + # Local scratch / tutorial outputs (not part of the codebase; users won't have these dirs). .baoyu-skills/ xhs-images/ diff --git a/crates/op-design-lint/tests/fixtures/golden/edge-section-padding.json b/crates/op-design-lint/tests/fixtures/golden/edge-section-padding.json index 7ced3d384..9158694df 100644 --- a/crates/op-design-lint/tests/fixtures/golden/edge-section-padding.json +++ b/crates/op-design-lint/tests/fixtures/golden/edge-section-padding.json @@ -5,7 +5,12 @@ "severity": "warning", "property": "padding", "currentValue": null, - "suggestedValue": [0, 16, 0, 16], + "suggestedValue": [ + 0, + 16, + 0, + 16 + ], "reason": "mobile root has 0 horizontal padding while 2 content section(s) glue text/icon to screen edge" } ] diff --git a/crates/op-design-lint/tests/fixtures/golden/stacked-horizontal-padding.json b/crates/op-design-lint/tests/fixtures/golden/stacked-horizontal-padding.json index 066f706c1..c42bd069d 100644 --- a/crates/op-design-lint/tests/fixtures/golden/stacked-horizontal-padding.json +++ b/crates/op-design-lint/tests/fixtures/golden/stacked-horizontal-padding.json @@ -4,7 +4,12 @@ "category": "stacked-horizontal-padding", "severity": "info", "property": "padding", - "currentValue": [0, 24, 0, 24], + "currentValue": [ + 0, + 24, + 0, + 24 + ], "suggestedValue": null, "reason": "section h-padding [24/24] stacks with root h-padding [16/16] — combined gutter 40/40" }