Expand description
Sage source code formatter.
Provides an opinionated, non-configurable formatter for Sage source code.
Similar in spirit to gofmt and rustfmt.
§Formatting Rules
- Indent with 4 spaces (no tabs)
- One blank line between top-level declarations
- Two blank lines before
runstatement - Handler ordering:
on start→on message→on error→on stop - Binary operators with spaces either side
- Closing braces on their own line
- Spawn initializer fields: one per line if >2 fields, inline if ≤2
Functions§
- format
- Formats a Sage program into canonical source code.