Skip to content

Run format before format:check in init hydration test validation#952

Open
Palcimer wants to merge 1 commit into
fedify-dev:mainfrom
Palcimer:issue-950-run-format-before-check
Open

Run format before format:check in init hydration test validation#952
Palcimer wants to merge 1 commit into
fedify-dev:mainfrom
Palcimer:issue-950-run-format-before-check

Conversation

@Palcimer

Copy link
Copy Markdown
Contributor

Summary

Current validateDevToolScripts only runs 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. Fixed by running format script before format:check so that scaffolded projects are already compliant with the formatter before being checked.

Assisted-by: Claude Code:claude-sonnet-5

Related issue

Changes

  • Added format script before format:check in validateDevToolScripts function.

Benefits

  • Test suites for package managers npm/pnpm will not fail because of format issue.

Checklist

  • [] Did you add a changelog entry to the CHANGES.md?
  • [] Did you write some relevant docs about this change (if it's a new feature)?
  • [] Did you write a regression test to reproduce the bug (if it's a bug fix)?
  • [] Did you write some tests for this change (if it's a new feature)?
  • Did you run mise test on your machine?

`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
@netlify

netlify Bot commented Jul 18, 2026

Copy link
Copy Markdown

Deploy Preview for fedify-json-schema canceled.

Name Link
🔨 Latest commit 918033f
🔍 Latest deploy log https://app.netlify.com/projects/fedify-json-schema/deploys/6a5b818aca07630008b5798e

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Astro developer-tool validation now runs the format script alongside format:check and lint in the hydration test.

Changes

Astro format validation

Layer / File(s) Summary
Update Astro validation scripts
packages/init/src/test/create.ts
Adds format to the Astro scripts executed by validateDevToolScripts.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: 2chanhaeng, dahlia

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: running format before format:check in init hydration validation.
Description check ✅ Passed The description matches the change and explains the formatting fix and its effect on hydration tests.
Linked Issues check ✅ Passed The change implements #950 by auto-formatting scaffolded projects before format:check and lint run.
Out of Scope Changes check ✅ Passed Only the requested validation order was changed; no unrelated code or behavior appears to be added.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 2d46cdb and 918033f.

📒 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"]) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 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.

Suggested change
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

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run format before format:check in fedify init's hydration test validation

1 participant