Format your code with `bynk-fmt`
Goal: format Bynk source to the canonical style.
Bynk’s formatter is built into the compiler as bynkc fmt.
Format files in place
Section titled “Format files in place”bynkc fmt src/counters.bynkbynkc fmt src/*.bynkThis rewrites the named files to canonical form (tab indentation, normalised spacing). For example:
commons demo {type Id=Intfn add(a:Int,b:Int)->Int{a+b}}becomes:
commons demo { type Id = Int
fn add(a: Int, b: Int) -> Int { a + b }}Format via stdin
Section titled “Format via stdin”Pass - to read from stdin and write to stdout — handy for editor integrations:
cat src/counters.bynk | bynkc fmt -Check formatting in CI
Section titled “Check formatting in CI”--check verifies formatting without writing, exiting non-zero if any file is
not already canonical:
bynkc fmt --check src/*.bynkRelated
Section titled “Related”- Set up editor support for format-on-save.
- Reference:
bynk-fmt.