-
-
Notifications
You must be signed in to change notification settings - Fork 12
feat(cli): add "format" command #419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Note Other AI code review bot(s) detectedCodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review. WalkthroughThis PR introduces a new ZModel schema formatting feature by adding a Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (7)
🧰 Additional context used🧬 Code graph analysis (4)packages/cli/test/format.test.ts (1)
packages/cli/src/actions/format.ts (2)
packages/cli/src/index.ts (1)
packages/language/src/document.ts (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (7)
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 |
|
Claude finished @ymc9's task —— View job PR Review: feat(cli): add "format" commandReviewing the addition of a new "format" command to the ZenStack CLI. Review Checklist
Review SummaryThis PR adds a clean and well-structured ✅ StrengthsCode Quality & Consistency
Implementation Quality
Testing
📝 Minor ObservationsTest Implementation ( Error Handling Consistency Documentation 🔒 Security & PerformanceSecurity: ✅ No security concerns
Performance: ✅ Good performance characteristics
📊 Test Coverage AssessmentThe test coverage is adequate for a formatting command:
📋 Recommendations
🏁 ConclusionThis is a well-implemented feature that follows ZenStack's established patterns and coding standards. The code quality is high, the integration is clean, and the functionality is properly tested. The only minor concern is a potential mismatch between test expectations and actual error handling behavior for invalid schemas. Recommendation: ✅ Approve - This PR is ready for merge after clarifying the test behavior for invalid schemas. |
|
Claude finished @ymc9's task —— View job PR Review: feat(cli): add "format" commandReviewing the addition of a new "format" command to the ZenStack CLI. Review Checklist
✅ Overall AssessmentThis is a well-implemented feature that adds formatting capabilities to the ZenStack CLI. The implementation is clean, follows existing patterns, and integrates well with the codebase architecture. 📋 Detailed ReviewCode Quality & Best Practices ⭐⭐⭐⭐⭐Strengths:
Minor improvements:
Implementation Analysis
|
|
Claude finished @ymc9's task —— View job PR Review: feat(cli): add "format" commandReviewing the addition of a new "format" command to the ZenStack CLI. Review Checklist
Review SummaryThis PR adds a clean and well-structured ✅ StrengthsCode Quality & Consistency
Implementation Quality
Testing
📝 Minor ObservationsTest Implementation ( Error Handling Consistency Documentation 🔒 Security & PerformanceSecurity: ✅ No security concerns
Performance: ✅ Good performance characteristics
📊 Test Coverage AssessmentThe test coverage is adequate for a formatting command:
📋 Recommendations
🏁 ConclusionThis is a well-implemented feature that follows ZenStack's established patterns and coding standards. The code quality is high, the integration is clean, and the functionality is properly tested. The only minor concern is a potential mismatch between test expectations and actual error handling behavior for invalid schemas. Recommendation: ✅ Approve - This PR is ready for merge after clarifying the test behavior for invalid schemas. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new format command to the CLI that formats ZModel schema files. The implementation exposes a formatDocument function from the language package and integrates it into the CLI with proper error handling and test coverage.
Key changes:
- Implements
formatDocumentfunction that uses the existingZModelFormatterto format schema content - Adds a new
formatCLI command with schema path options - Includes basic test coverage for valid and invalid schema formatting
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/language/src/index.ts | Exports the new formatDocument function |
| packages/language/src/document.ts | Implements formatDocument function using Langium formatter services |
| packages/cli/src/index.ts | Registers the new format command with CLI program |
| packages/cli/src/actions/index.ts | Exports the format action (reordered alphabetically) |
| packages/cli/src/actions/format.ts | Implements the format action that reads, formats, and writes schema files |
| packages/cli/test/format.test.ts | Adds test coverage for the format command |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary by CodeRabbit
Release Notes
formatCLI command to format and standardize ZModel schema files with consistent indentation and code style.