mirror of
https://github.com/tofuutils/pre-commit-opentofu.git
synced 2025-10-15 17:38:54 +02:00
fix: Speed up x2 TFLint hook execution in dirs with violations (#514)
Co-authored-by: Maksym Vlasov <MaxymVlasov@users.noreply.github.com>
This commit is contained in:
parent
098150538d
commit
49974ab9ef
1 changed files with 6 additions and 7 deletions
|
|
@ -50,16 +50,15 @@ function per_dir_hook_unique_part {
|
|||
shift
|
||||
local -a -r args=("$@")
|
||||
|
||||
# Print checked PATH **only** if TFLint have any messages
|
||||
# shellcheck disable=SC2091,SC2068 # Suppress error output
|
||||
$(tflint ${args[@]} 2>&1) 2> /dev/null || {
|
||||
common::colorify "yellow" "TFLint in $dir_path/:"
|
||||
TFLINT_OUTPUT=$(tflint "${args[@]}" 2>&1)
|
||||
local exit_code=$?
|
||||
|
||||
tflint "${args[@]}"
|
||||
}
|
||||
if [ $exit_code -ne 0 ]; then
|
||||
common::colorify "yellow" "TFLint in $dir_path/:"
|
||||
echo "$TFLINT_OUTPUT"
|
||||
fi
|
||||
|
||||
# return exit code to common::per_dir_hook
|
||||
local exit_code=$?
|
||||
return $exit_code
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue