Gate OpenTofu formatting before an initialized validation job
A configuration review can be technically correct and still be difficult to verify because a one-line expression has been compressed into a shape that hides its arguments, references, or closing braces. It is tempting to make tofu validate the first automated check, but validation has a different dependency boundary: OpenTofu requires an initialized working directory with its referenced providers and modules available. Formatting does not.
The useful first gate is tofu fmt -check -diff. It reads local configuration, reports canonical-format drift, shows the change it would make, and does not rewrite the files. That makes it suitable for a pull-request or pre-commit step before a job initializes a backend, downloads providers, or obtains cloud credentials.