Skip to content

📝 document yarn format --write in AGENTS.md - #5125

Draft
thomas-lebeau wants to merge 1 commit into
mainfrom
thomas.lebeau/agents-md-format
Draft

thomas-lebeau wants to merge 1 commit into
mainfrom
thomas.lebeau/agents-md-format

Conversation

@thomas-lebeau

Copy link
Copy Markdown
Collaborator

Motivation

AGENTS.md listed yarn format under "Format code", but the script is prettier --check .: it only reports issues and never modifies files. Agents (and humans) following it after a bulk edit believe the code was formatted when it wasn't, and the format CI job fails afterwards — this happened on #5022. Agents also tend to fall back to calling yarn prettier directly, which can diverge from what CI checks.

Changes

Documentation only, root AGENTS.md "Key Commands":

  • Relabel yarn format as a check (--check, does not modify files).
  • Add yarn format --write to fix formatting (Yarn appends the flag; Prettier 3 accepts --check --write, rewrites the files and lists them).
  • Add a short note to always go through the yarn format script rather than yarn prettier, and to check its output after scripted/bulk edits.

Test instructions

printf 'const   x = {a:1}\n' > tmp-probe.ts
yarn format          # reports tmp-probe.ts, file unchanged
yarn format --write  # "Code style issues fixed", file rewritten
rm tmp-probe.ts

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

@thomas-lebeau

Copy link
Copy Markdown
Collaborator Author

@DataDog review

@datadog-datadog-us1-prod datadog-datadog-us1-prod 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.

Bits Code Review: PASS

More details

The revised instructions distinguish formatting checks from fixes and match the repository’s formatting script and CI usage. The completed static review identified no actionable issues.

Was this helpful? React 👍 or 👎

Open Bits AI session

🤖 Bits Code Review · Commit e2df186

This branch has not been deployed

No deployments
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.

1 participant