aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDhananjay Balan <mail@dbalan.in>2023-10-29 23:17:34 +0100
committerGitHub <noreply@github.com>2023-10-29 15:17:34 -0700
commit5bade7a734eb485a22cb7e62fcc1264b08d862bc (patch)
treeb2f0c42c4c04b16f4e7c59e03bc408a2e9057325 /test
parentf4157e8c397896c0b984472ef7f82f444e0fc3e2 (diff)
Use hclfmt to format hashicorp HCL files. (#231)
Add formatter `hclfmt` for Hashicorp Configuration Langauge (HCL).
Diffstat (limited to 'test')
-rw-r--r--test/formatters/installers/hclfmt.bash3
-rw-r--r--test/formatters/samplecode/hclfmt/in.hcl9
-rw-r--r--test/formatters/samplecode/hclfmt/out.hcl9
3 files changed, 21 insertions, 0 deletions
diff --git a/test/formatters/installers/hclfmt.bash b/test/formatters/installers/hclfmt.bash
new file mode 100644
index 0000000..f2dd51b
--- /dev/null
+++ b/test/formatters/installers/hclfmt.bash
@@ -0,0 +1,3 @@
+apt-get install -y golang-go
+go install github.com/hashicorp/hcl/v2/cmd/hclfmt@latest
+cp -L "$HOME/go/bin/hclfmt" /usr/local/bin/
diff --git a/test/formatters/samplecode/hclfmt/in.hcl b/test/formatters/samplecode/hclfmt/in.hcl
new file mode 100644
index 0000000..2b77020
--- /dev/null
+++ b/test/formatters/samplecode/hclfmt/in.hcl
@@ -0,0 +1,9 @@
+block {
+ whatever = 1
+ format = "iam in"
+}
+
+vars = {
+equals = "needs"
+ aligned = "properly"
+}
diff --git a/test/formatters/samplecode/hclfmt/out.hcl b/test/formatters/samplecode/hclfmt/out.hcl
new file mode 100644
index 0000000..2e0be84
--- /dev/null
+++ b/test/formatters/samplecode/hclfmt/out.hcl
@@ -0,0 +1,9 @@
+block {
+ whatever = 1
+ format = "iam in"
+}
+
+vars = {
+ equals = "needs"
+ aligned = "properly"
+}