forked from github/pre-commit-opentofu
feat: Adding init to terraform_tflint hook (#352)
This commit is contained in:
parent
ac54720b91
commit
1aff30f2a4
1 changed files with 7 additions and 0 deletions
|
|
@ -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 || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue