o
odinpkg.dev
packages / tool / lucyfmt

lucyfmt

2efaa31tool

Minimalistic Odin language formatter

No license · updated 3 months ago

lucyfmt

Minimalistic Odin formatter.

  • Indents lines with 1 tab per scope level
  • Does not indent when blocks
  • Leaves the contents like multi line strings and multi line comments untouched
  • Adds one indent level to parameters if they were broken up into multiple lines. example:

input:

	fmt.printfln("%v %v %v",
	a,
	3,
	5
	)

output:

	fmt.printfln("%v %v %v",
		a,
		3,
		5
	)

Build

odin build . -out:lucyfmt

Usage

./lucyfmt file.odin          # print to stdout
./lucyfmt -w file.odin       # format in-place
cat file.odin | ./lucyfmt    # read from stdin