feat: Adding init to terraform_tflint hook (#352)

This commit is contained in:
Andrew Glenn 2022-04-13 09:15:15 -05:00 committed by GitHub
commit 1aff30f2a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -34,6 +34,13 @@ function per_dir_hook_unique_part {
local -r args="$1"
local -r dir_path="$2"
# shellcheck disable=SC2091,SC2068 # Suppress error output
TFLINT_INIT=$(tflint --init 2>&1) 2> /dev/null || {
local exit_code=$?
common:colorify "yellow" "tflint init:"
echo "${TFLINT_INIT}"
return ${exit_code}
}
# Print checked PATH **only** if TFLint have any messages
# shellcheck disable=SC2091,SC2068 # Suppress error output
$(tflint ${args[@]} 2>&1) 2> /dev/null || {