Run format before format:check in init hydration test validation#952
Run format before format:check in init hydration test validation#952Palcimer wants to merge 1 commit into
format before format:check in init hydration test validation#952Conversation
`validateDevToolScripts` only ran `format:check` and `lint` after scaffolding a project, without auto-formatting it first. Since neither Fedify's own generated files nor most scaffolding CLI output exactly match the project's chosen formatter's style, `format:check` almost always failed for `npm`/`pnpm` package managers, causing the entire hydration test suite to fail regardless of the actual generated code. fedify-dev#950 Assisted-by: Claude Code:claude-sonnet-5
✅ Deploy Preview for fedify-json-schema canceled.
|
There was a problem hiding this comment.
Code Review
This pull request updates the validateDevToolScripts function in packages/init/src/test/create.ts to include the "format" script in the validation loop alongside "format:check" and "lint". There are no review comments, and I have no feedback to provide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
📝 WalkthroughWalkthroughAstro developer-tool validation now runs the ChangesAstro format validation
Estimated code review effort: 1 (Trivial) | ~2 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@packages/init/src/test/create.ts`:
- Line 158: Update the shared validation loop to include only format:check and
lint, removing format from the scripts iterated there. Preserve the existing
Astro-specific format execution so Astro projects run format once, while other
frameworks are not required to define a format script.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 743a417a-8773-43b8-9f92-3fdd8fe34851
📒 Files selected for processing (1)
packages/init/src/test/create.ts
| } | ||
|
|
||
| for (const script of ["format:check", "lint"]) { | ||
| for (const script of ["format", "format:check", "lint"]) { |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Keep format out of the shared validation loop.
The Astro-specific block at Lines 146-156 already runs format, so this causes Astro projects to format twice. It also makes every non-Deno framework require a format script, although this change targets Astro and the previous shared validation only ran format:check and lint.
- for (const script of ["format", "format:check", "lint"]) {
+ for (const script of ["format:check", "lint"]) {📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| for (const script of ["format", "format:check", "lint"]) { | |
| for (const script of ["format:check", "lint"]) { |
🤖 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/init/src/test/create.ts` at line 158, Update the shared validation
loop to include only format:check and lint, removing format from the scripts
iterated there. Preserve the existing Astro-specific format execution so Astro
projects run format once, while other frameworks are not required to define a
format script.
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
Summary
Current
validateDevToolScriptsonly runsformat:checkandlintafter scaffolding a project, without auto-formatting it first. Since neither Fedify's own generated files nor most scaffolding CLI output exactly match the project's chosen formatter's style,format:checkalmost always failed fornpm/pnpmpackage managers, causing the entire hydration test suite to fail regardless of the actual generated code. Fixed by runningformatscript beforeformat:checkso that scaffolded projects are already compliant with the formatter before being checked.Assisted-by: Claude Code:claude-sonnet-5
Related issue
formatbeforeformat:checkinfedify init's hydration test validation #950Changes
formatscript beforeformat:checkinvalidateDevToolScriptsfunction.Benefits
npm/pnpmwill not fail because of format issue.Checklist
Did you write some relevant docs about this change (if it's a new feature)?Did you write some tests for this change (if it's a new feature)?mise teston your machine?