Skip to content

Commit 3a84ea0

Browse files
committed
ci(regen): rustfmt generated code to keep regen diffs reviewable
1 parent c7714a1 commit 3a84ea0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/regenerate.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
3232
with:
3333
toolchain: stable
34+
components: rustfmt
3435

3536
- name: Fetch merged OpenAPI spec
3637
env:
@@ -91,6 +92,14 @@ jobs:
9192
--http-user-agent "hotdata-rust/${PACKAGE_VERSION}" \
9293
--skip-validate-spec
9394
95+
# The 7.22.0 generator emits compact, non-rustfmt output, which buries real
96+
# spec changes under formatting churn in every regen diff. Format only the
97+
# generated subtrees so the diff shows semantic changes; the hand-written
98+
# ergonomic layer is left to its own formatting (and is ignore-protected
99+
# from the generator anyway).
100+
- name: Format generated code
101+
run: find src/apis src/models -name '*.rs' -print0 | xargs -0 rustfmt --edition 2021
102+
94103
- name: Clean up fetched spec
95104
run: rm -f openapi.yaml
96105

0 commit comments

Comments
 (0)