feat(fmt): add single-file formatting core - #115
Conversation
Deploying rstack-cli with
|
| Latest commit: |
8363eb7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://ea0b02c4.rstack-cli.pages.dev |
| Branch Preview URL: | https://chenjiahan-feat-format-text.rstack-cli.pages.dev |
📝 WalkthroughWalkthroughAdds the typed 🚥 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 |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/rstack/tests/fmt/format.test.ts (1)
1-77: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd regression coverage for plugin rejection.
packages/rstack/src/fmt/format.tsexplicitly rejects configured plugins, but this changed test file does not verify that contract. Add a test asserting thatformatTextrejects with the expected error when plugins are configured.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/rstack/tests/fmt/format.test.ts` around lines 1 - 77, Add a regression test alongside the existing formatText tests that configures at least one plugin, invokes formatText with that configuration, and asserts it rejects with the expected plugin-rejection error from format.ts. Keep the assertion focused on the established error contract and preserve the existing test patterns.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/rstack/tests/fmt/format.test.ts`:
- Around line 1-77: Add a regression test alongside the existing formatText
tests that configures at least one plugin, invokes formatText with that
configuration, and asserts it rejects with the expected plugin-rejection error
from format.ts. Keep the assertion focused on the established error contract and
preserve the existing test patterns.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: d3c529e1-a7e8-4a49-b075-c9529a759d0c
📒 Files selected for processing (3)
packages/rstack/src/fmt/format.tspackages/rstack/src/fmt/types.tspackages/rstack/tests/fmt/format.test.ts
This PR adds the internal single-file formatting core needed by the future
rs fmtpipeline. It resolves per-file options, infers supported parsers without loading external Prettier config or ignore files, and maps cursor positions when requested. Unsupported file types return a structured skip result, while plugin handling remains deferred until project-root plugin resolution is implemented. This change does not add anrs fmtcommand or public package export.