chore: exclude ZenStack-generated files from prettier formatting - #2786
Merged
Conversation
PR #2779 ran prettier over tracked generated files (schema.ts, schema-lite.ts, models.ts, input.ts). During the release workflow, sample/test builds run `zen generate` which rewrites these files with the generator's own formatting, leaving the working tree dirty and causing `pnpm publish` to fail with ERR_PNPM_GIT_UNCLEAN (v3.9.0 release run). - extend .prettierignore to cover all generated file names, including schema-lite.ts and tests/runtimes/**, which were previously missed - restore the affected generated files to pristine generator output Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (8)
📝 WalkthroughWalkthroughThe PR expands ChangesRepository formatting alignment
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The v3.9.0 release run (failed job) died in the
Publish packagesstep withERR_PNPM_GIT_UNCLEAN.Root cause: #2779 ran prettier over tracked generated files (
schema.ts,schema-lite.ts,models.ts,input.tsundersamples/,tests/, and package test dirs). In the release workflow, sample/test builds runzen generate, which rewrites those files with the generator's own formatting (double quotes, no trailing commas), leaving modified tracked files in the working tree — sopnpm -r publishfails its git-clean check.Changes
.prettierignoreto cover all ZenStack-generated file names. The previous list missedschema-lite.tsentirely and didn't covertests/runtimes/**. Patterns stay scoped tosamples/,tests/, and**/test/**because a few hand-written source files share these names (packages/orm/src/schema.ts,packages/schema/src/schema.ts,packages/testtools/src/schema.ts).pnpm builddirties back to pristine generator output, so builds no longer touch the tree.This also prevents recurrence via the pre-commit hook:
lint-stagedrunsprettier --writeon staged*.ts, which would otherwise re-format regenerated files on every commit.Verification
prettier --list-differentnow reports none of them (the restored files use generator formatting, so they would be flagged if the ignore rules didn't match).pnpm build(minusbun-e2e, no bun installed locally) leaves the working tree clean.After this merges to
main, the failed release can be re-triggered via workflow dispatch.🤖 Generated with Claude Code
Summary by CodeRabbit
Style
Documentation
Chores