Skip to content

docs(AGENTS): add mandatory pre-commit format step#3920

Open
desiree-np wants to merge 1 commit intomainfrom
docs/agents-format-pre-commit
Open

docs(AGENTS): add mandatory pre-commit format step#3920
desiree-np wants to merge 1 commit intomainfrom
docs/agents-format-pre-commit

Conversation

@desiree-np
Copy link
Copy Markdown
Collaborator

Summary

  • Add a Pre-Commit Checklist section to packages/react/AGENTS.md that makes pnpm format mandatory before every commit
  • Add pnpm format and pnpm format:check to the Available Commands reference

Why

Every PR has been failing the Format CI check because oxfmt was not being run before committing. This documents the requirement explicitly so any AI agent (or human) working in this package knows to run it.

@desiree-np desiree-np requested a review from a team as a code owner April 13, 2026 09:41
Copilot AI review requested due to automatic review settings April 13, 2026 09:41
@github-actions github-actions bot added docs react Changes affect packages/react labels Apr 13, 2026
@github-actions
Copy link
Copy Markdown
Contributor

✅ No New Circular Dependencies

No new circular dependencies detected. Current count: 0

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds explicit formatting guidance to the React package agent documentation to reduce CI Format job failures by ensuring contributors run the formatter locally before committing.

Changes:

  • Introduces a mandatory “Pre-Commit Checklist” in packages/react/AGENTS.md with format and tsc steps.
  • Expands the “Available Commands” list to include pnpm format and pnpm format:check.

Before **every** `git commit`, run these two commands — no exceptions:

```bash
# 1. Format all changed source files
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

The comment says “Format all changed source files”, but @factorialco/f0-react’s format script runs oxfmt on src/ by default (i.e., it formats the whole package source tree unless args are provided). Consider rewording to avoid implying it only touches changed files, or pass explicit paths if that’s the intent.

Suggested change
# 1. Format all changed source files
# 1. Format the package source files

Copilot uses AI. Check for mistakes.
Comment on lines +18 to +19
`oxfmt` rewrites whitespace, quote style, trailing commas, and import order — always run it last,
after all code edits are done, and include the resulting changes in the same commit.
Copy link

Copilot AI Apr 13, 2026

Choose a reason for hiding this comment

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

This paragraph says to “always run [oxfmt] last”, but the checklist below runs tsc after format. Either clarify that “last” means “last step that modifies files”, or swap the command order to match the guidance.

Suggested change
`oxfmt` rewrites whitespace, quote style, trailing commas, and import order — always run it last,
after all code edits are done, and include the resulting changes in the same commit.
`oxfmt` rewrites whitespace, quote style, trailing commas, and import order — always run it as the
last step that modifies files, after all code edits are done, and include the resulting changes in the same commit.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

📦 Alpha Package Version Published

Use pnpm i github:factorialco/f0#npm/alpha-pr-3920 to install the package

Use pnpm i github:factorialco/f0#57301faa3c0f5ceb5119289752d66c8448ac1a14 to install this specific commit

@github-actions
Copy link
Copy Markdown
Contributor

🔍 Visual review for your branch is published 🔍

Here are the links to:

@github-actions
Copy link
Copy Markdown
Contributor

Coverage Report for packages/react

Status Category Percentage Covered / Total
🔵 Lines 46.33% 11507 / 24832
🔵 Statements 45.57% 11863 / 26032
🔵 Functions 38% 2588 / 6809
🔵 Branches 38.2% 7576 / 19830
File CoverageNo changed files found.
Generated in workflow #12765 for commit f0728c0 by the Vitest Coverage Report Action

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

Labels

docs react Changes affect packages/react

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants