HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

tofu fmt — Format configuration according to OpenTofu language style conventions. More information: <https://op

Submitted by: @import:tldr-pages··
0
Viewed 0 times
accordingconfigurationcommandlanguageformatclitofu fmtopentofu

Problem

How to use the tofu fmt command: Format configuration according to OpenTofu language style conventions. More information: <https://opentofu.org/docs/cli/commands/fmt/>.

Solution

tofu fmt — Format configuration according to OpenTofu language style conventions. More information: <https://opentofu.org/docs/cli/commands/fmt/>.

Format the configuration in the current directory:
tofu fmt


Format the configuration in the current directory and subdirectories:
tofu fmt -recursive


Display diffs of formatting changes:
tofu fmt -diff


Do not list files that were formatted to stdout:
tofu fmt -list=false

Code Snippets

Format the configuration in the current directory

tofu fmt

Format the configuration in the current directory and subdirectories

tofu fmt -recursive

Display diffs of formatting changes

tofu fmt -diff

Do not list files that were formatted to `stdout`

tofu fmt -list=false

Context

tldr-pages: common/tofu fmt

Revisions (0)

No revisions yet.