Skip to content

Commit 38c7aa6

Browse files
committed
adds tf_fmt to format
1 parent a5515e8 commit 38c7aa6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tools/terraform.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,16 @@ function tf_apply {
7575
# terraform fmt
7676
}
7777

78+
# see https://opentofu.org/docs/cli/commands/fmt/
79+
function tf_fmt {
80+
if tofu fmt -list=true -diff -check; then
81+
echo "✅ everything formatted"
82+
else
83+
echo "✏️ formatted"
84+
tofu fmt -list=true
85+
fi
86+
}
87+
7888
function tf_import {
7989
local resource=$1
8090
local aws_address=$2

0 commit comments

Comments
 (0)