The format command rewrites or prints .pta source in canonical Partitura style.
Syntax
partitura format <input.pta>
partitura format <input.pta> -o <output.pta>
partitura format <input.pta> --check
Arguments
| Argument | Required | Description |
|---|---|---|
<input.pta> |
Yes | Input .pta source file |
Flags
| Flag | Description |
|---|---|
-o <path> |
Write formatted output to file instead of stdout |
--check |
Check if file is already formatted; exit non-zero if not |
--diff |
Show a diff of changes without modifying the file |
Examples
# Print formatted output to stdout
partitura format score.pta
# Rewrite file in place
partitura format score.pta -o score.pta
# Check if file is already formatted
partitura format score.pta --check
Requirements
- Produces canonical formatting
- Preserves source semantics
- Fails if formatting cannot be completed safely
Formatting Rules
Canonical formatting uses:
- Two-space indentation
- Opening braces on the same line as the block header
- One field or block entry per line
- Canonical block and field ordering
- Double-quoted strings
true/falsebooleans@identifierreferences
See Formatting for the complete reference.
Exit Codes
| Code | Meaning |
|---|---|
0 |
Success (or already formatted with --check) |
1 |
Formatting error |
2 |
Usage error |
See Also
- Formatting — Canonical formatting rules
- validate — Validate
.ptasource