Skip to content

Commit 1aff30f

Browse files
authored
feat: Adding init to terraform_tflint hook (antonbabenko#352)
1 parent ac54720 commit 1aff30f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hooks/terraform_tflint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ function per_dir_hook_unique_part {
3434
local -r args="$1"
3535
local -r dir_path="$2"
3636

37+
# shellcheck disable=SC2091,SC2068 # Suppress error output
38+
TFLINT_INIT=$(tflint --init 2>&1) 2> /dev/null || {
39+
local exit_code=$?
40+
common:colorify "yellow" "tflint init:"
41+
echo "${TFLINT_INIT}"
42+
return ${exit_code}
43+
}
3744
# Print checked PATH **only** if TFLint have any messages
3845
# shellcheck disable=SC2091,SC2068 # Suppress error output
3946
$(tflint ${args[@]} 2>&1) 2> /dev/null || {

0 commit comments

Comments
 (0)