
helmfmt — Finally, a Formatter for Helm Charts
If you work with Helm, you know the pain: Go-template directives scattered across YAML files with no consistent indentation. Standard YAML formatters can't help — they don't understand Go templates. And gofmt doesn't know about YAML. helmfmt fills this gap. What It Does helmfmt creates consistent formatting for Helm templates. It auto-aligns Go-template indentation for control blocks (e.g., {{ if ... }} , {{ range ... }} ), variables, and comments, improving readability. Importantly, it does not affect raw YAML structure, keeping your chart valid while making it cleaner. What Gets Formatted The tool handles indentation for control blocks ( range , with , define , block ), branching ( if , else , else if , end ), variables ( {{ $var := ... }} ), and some functions like fail , printf , etc. Comments ( {{/* ... */}} ) are also covered. Flexible Configuration helmfmt can be configured using a .helmfmt file in JSON format, where you can tweak indent size, file extensions, and toggle indenta
Continue reading on Dev.to
Opens in a new tab



