Skip to content

Commit f3d711d

Browse files
cortinicometa-codesync[bot]
authored andcommitted
Document the repository formatting command (#58458)
Summary: Pull Request resolved: #58458 Document `yarn format`, `yarn format-check`, every `format-<language>` / `format-check-<language>` command, and the prerequisite checks that warn and skip unavailable language toolchains. Changelog: [Internal] Differential Revision: D119487619
1 parent 4522d7e commit f3d711d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,15 @@ Architecture notes live in `__docs__` directories beside the code they describe,
3434
| `yarn fantom <path>` | [Fantom](private/react-native-fantom/__docs__/README.md) integration tests, named `*-itest.js` — builds a native tester on first run |
3535
| `yarn lint` | ESLint (`--max-warnings 0`) |
3636
| `yarn flow-check` | Flow |
37-
| `yarn format` | Prettier and clang-format (`yarn format-check` for Prettier only) |
37+
| `yarn format` | Format JavaScript/TypeScript, C/C++/Objective-C/protobuf, Kotlin, Java, Python, and Swift sources |
38+
| `yarn format-check` | Check all repository formatting without changing files |
39+
| `yarn format-<language>` | Format one language: `javascript`, `cpp`, `kotlin`, `java`, `python`, or `swift` |
40+
| `yarn format-check-<language>` | Check one language without changing files |
3841

3942
JavaScript CI is the `lint`, `test_js`, and `build_js_types` jobs in [`.github/workflows/test-all.yml`](.github/workflows/test-all.yml); Fantom and the native platforms have their own jobs.
4043

44+
The formatting command uses pinned npm packages for Kotlin and Java and installs pinned Ruff through Python. To format every language, install a JDK with Java 17 or newer, Python 3 with pip, and a Swift 6.3 or newer toolchain in addition to Node and Yarn. Each language wrapper checks its own requirements and prints installation guidance when something is missing; `yarn format` then skips that language and continues formatting the others. Swift formatting accepts either `swift-format` or `swift format` from the installed toolchain.
45+
4146
### Verification: Running RNTester
4247

4348
Needed only for changes that have to be seen running, such as user interface behavior.

0 commit comments

Comments
 (0)