Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/regenerate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- uses: dtolnay/rust-toolchain@29eef336d9b2848a0b548edc03f92a220660cdb8 # stable
with:
toolchain: stable
components: rustfmt

- name: Fetch merged OpenAPI spec
env:
Expand Down Expand Up @@ -91,6 +92,20 @@ jobs:
--http-user-agent "hotdata-rust/${PACKAGE_VERSION}" \
--skip-validate-spec

# The 7.22.0 generator emits compact, non-rustfmt output, which buries real
# spec changes under formatting churn in every regen diff. Format only the
# generated subtrees so the diff shows semantic changes; the hand-written
# ergonomic layer is left to its own formatting (and is ignore-protected
# from the generator anyway).
- name: Format generated code
run: |
# Derive the edition from Cargo.toml so it can't drift from the crate
# if the edition is ever bumped (same source as the version bump above).
edition=$(cargo metadata --no-deps --format-version 1 \
| jq -r '.packages[] | select(.name=="hotdata") | .edition')
find src/apis src/models -name '*.rs' -print0 \
| xargs -0 rustfmt --edition "$edition"

- name: Clean up fetched spec
run: rm -f openapi.yaml

Expand Down
Loading