> ## Documentation Index
> Fetch the complete documentation index at: https://docs.poly.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# poly format

> Reference for the `poly format` command.

Run ruff (lint + format) on Python resources and formatting on YAML/JSON resources.

Examples:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
poly format
poly format --path /path/to/project
poly format --check
```

By default, applies fixes: `ruff check --fix` and `ruff format` for Python, and in-process formatting for YAML and JSON. Use `--check` to only verify without writing changes. Use `--ty` to also run type checking (via `ty`) after formatting.

| Flag | Description |
| - | - |
| `--files` | Specific files/dirs to format. If not specified, runs on the whole `--path` tree. |
| `--check` | Only check; do not write. Reports Python/YAML/JSON files that would be reformatted and exits non-zero if any are found. |
| `--ty` | Also run type checking (`ty`). Off by default because it can hang on some systems; times out after 15 seconds. |

`--json` output shape:

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
{
  "success": true,
  "check_only": false,
  "format_errors": [],
  "affected": [],
  "ty_ran": false,
  "ty_returncode": null,
  "ty_timed_out": false
}
```

See also [`poly push --format`](https://docs.poly.ai/adk/reference/cli/push) to run formatting automatically as part of a push, and [`poly validate`](https://docs.poly.ai/adk/reference/cli/validate) to check project configuration.
