feat: TFLint: Add --hook-config=--delegate-chdir to use tflint -chdir (#512)

Co-authored-by: Maksym Vlasov <MaxymVlasov@users.noreply.github.com>
This commit is contained in:
Luke 2023-05-08 11:32:06 -04:00 committed by GitHub
commit 1e9debc02f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 101 additions and 16 deletions

View file

@ -70,13 +70,18 @@ function match_validate_errors {
# Arguments:
# dir_path (string) PATH to dir relative to git repo root.
# Can be used in error logging
# change_dir_in_unique_part (string/false) Modifier which creates
# possibilities to use non-common chdir strategies.
# Availability depends on hook.
# args (array) arguments that configure wrapped tool behavior
# Outputs:
# If failed - print out hook checks status
#######################################################################
function per_dir_hook_unique_part {
local -r dir_path="$1"
shift
# shellcheck disable=SC2034 # Unused var.
local -r change_dir_in_unique_part="$2"
shift 2
local -a -r args=("$@")
local exit_code
@ -95,7 +100,7 @@ function per_dir_hook_unique_part {
case $key in
--retry-once-with-cleanup)
if [ $retry_once_with_cleanup ]; then
if [ $retry_once_with_cleanup ]; then
common::colorify "yellow" 'Invalid hook config. Make sure that you specify not more than one "--retry-once-with-cleanup" flag'
exit 1
fi