File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 - uses : dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
3232 with :
3333 toolchain : stable
34+ components : rustfmt
3435
3536 - name : Fetch merged OpenAPI spec
3637 env :
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 : |
102+ # Derive the edition from Cargo.toml so it can't drift from the crate
103+ # if the edition is ever bumped (same source as the version bump above).
104+ edition=$(cargo metadata --no-deps --format-version 1 \
105+ | jq -r '.packages[] | select(.name=="hotdata") | .edition')
106+ find src/apis src/models -name '*.rs' -print0 \
107+ | xargs -0 rustfmt --edition "$edition"
108+
94109 - name : Clean up fetched spec
95110 run : rm -f openapi.yaml
96111
You can’t perform that action at this time.
0 commit comments