This specification serves as a starting point to document how nufmt
should work when formatting nushell scripts. It's meant to be very basic at this point, gradually covering more of the language features.
There should be an --indent
parameter to allow one to specify the number of spaces to use for indentation.
This is the list of the supported commands and their idiomatic formatting. Indentation will be covered by the --indent
flag but for these examples, 2 spaces will be used.
The if clause should look like this.
if condition {
// some thing
} else if {
// some other thing
} else {
// else the last thing
}
The for command should have formatting like this
for var in 0..100 {
// do something here
}