keel fmt
Auto-format a Keel file with consistent style.
keel fmt <file.keel>
What it does
- 2-space indentation
- Consistent spacing around operators and
@attributevalues - One declaration per section with blank line separators
- Single-line
whenarms for simple expressions - Writes the formatted output back to the file
Example
Before:
use std/io
use std/schedule
agent Bot{@role "helper"
state{count:int=0}
@on_start{schedule.every(1.day, () => {io.notify("hello")
self.count=self.count+1})}}
run(Bot)
After keel fmt:
use std/io
use std/schedule
agent Bot {
@tools [io]
@role "helper"
state {
count: int = 0
}
@on_start {
schedule.every(1.day, () => {
io.notify("hello")
self.count = self.count + 1
})
}
}
run(Bot)