packer fmt Packer command is used to format HCL2 configuration files to
a canonical format and style. JSON files (.json) are not modified. This command
applies a subset of HCL language style conventions, along with other minor
adjustments for readability.
packer fmt will display the name of the configuration file(s) that need formatting,
and write any formatted changes back to the original configuration file(s).
Check if configuration file(s) need to be formatted, but don't write the changes.
$ packer fmt -check . my-template.json
Format a configuration file, writing the changes back to the original file.
$ packer fmt my-template.json my-template.json