packer-cn/hcl2template/testdata
Wilken Rivera acabc1c1aa
Add packer fmt command (#10225)
* Add packer fmt command

This change adds a new command that allows users to format one or more
HCL2 Packer configuration template files.

Related to: #9174

* command/fmt: Add check flag

Packer's fmt command now supports a check flag that will output the name
of any file that would be changed by the HCL2 formatting engine. The
check flag is mutually exclusive with the write flag and will only check
if formatting is needed.

The update write flag will now overwrite the source files with the newly
formatted HCL2 source unless the `-write=false` or `-check` is passed at
the command line.

* Returns a diagnostic error if Format is unable to show a diff - equivalent to `terraform fmt`
* Updates testing to run against #Format and not the private methods of the HCL2Formatter; fixes ShowDiff test failure on Windows
* Updates comments for exported functions

* Add docs for fmt command
2020-11-11 11:49:39 -05:00
..
build add test 2020-09-30 12:02:52 +02:00
build.pkr.hcl HCL2: when we see a map generate an attribute spec instead of a block spec (#9035) 2020-04-14 16:05:13 +02:00
communicator HCL2: when we see a map generate an attribute spec instead of a block spec (#9035) 2020-04-14 16:05:13 +02:00
complete HCL2: add post-processors block to run multiple post-processor after a build (#9638) 2020-07-28 10:02:37 +02:00
empty better empty folder test 2020-01-06 16:09:44 +01:00
format Add packer fmt command (#10225) 2020-11-11 11:49:39 -05:00
sources HCL2: when we see a map generate an attribute spec instead of a block spec (#9035) 2020-04-14 16:05:13 +02:00
unknown remove unecessary inexistant block panic + add test 2020-01-06 16:56:42 +01:00
variables add VariableAssignment struct that help describe an input var assignment 2020-11-02 15:22:29 +01:00