tofu fmt
tofu fmt [-check] [-diff] [-recursive]
Risk: Safe
What it does
Tidies .tf files: spaces, indents and lined-up = signs. Same meaning.
When to use it
Before every commit. CI runs tofu fmt -check.
Example
$ tofu fmtTidy every .tf file in this folder.
$ tofu fmt -checkOnly check. Lists messy files; changes nothing.
$ tofu fmt -diffShow the changes it makes.
Learn it in: fmt and validate · Official docs