feat: Improve performance during pre-commit --all (-a) run (#327)

This commit is contained in:
Carlos Miguel Bustillo Rodríguez 2022-02-10 16:53:37 +01:00 committed by GitHub
commit 7e7c91643e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 106 additions and 7 deletions

View file

@ -2,6 +2,9 @@
set -eo pipefail
# globals variables
# hook ID, see `- id` for details in .pre-commit-hooks.yaml file
readonly HOOK_ID='terraform_tflint'
# shellcheck disable=SC2155 # No way to assign to readonly variable in separate lines
readonly SCRIPT_DIR="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
# shellcheck source=_common.sh
@ -14,7 +17,7 @@ function main {
# shellcheck disable=SC2178 # It's the simplest syntax for that case
ARGS=${ARGS[*]/__GIT_WORKING_DIR__/$(pwd)\/}
# shellcheck disable=SC2128 # It's the simplest syntax for that case
common::per_dir_hook "$ARGS" "${FILES[@]}"
common::per_dir_hook "$ARGS" "$HOOK_ID" "${FILES[@]}"
}
#######################################################################