Skip to content

Commit

Permalink
add specification to get started documenting
Browse files Browse the repository at this point in the history
  • Loading branch information
fdncred committed Mar 20, 2023
1 parent 8221da0 commit e38faa9
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions docs/specification.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Specification

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.


## Supported Features

### Indentation

There should be an `--indent` parameter to allow one to specify the number of spaces to use for indentation.

### Supported Commands

This is the list of the supported commands and their idiomatic formatting.

#### if

The if clause should look like this. Indentation will be covered by the `--indent` flag but for these examples, 2 spaces will be used.

```rust
if condition {
// some thing
} else if {
// some other thing
} else {
// else the last thing
}
```

0 comments on commit e38faa9

Please sign in to comment.