chore: Implement DRY for HOOK_ID (#405)

This commit is contained in:
Maksym Vlasov 2022-07-05 15:24:58 +03:00 committed by Anton Babenko
commit 0f25122485
13 changed files with 6 additions and 30 deletions

View file

@ -2,10 +2,6 @@
set -eo pipefail
# globals variables
# hook ID, see `- id` for details in .pre-commit-hooks.yaml file
# shellcheck disable=SC2034 # Unused var.
HOOK_ID=${0##*/}
readonly HOOK_ID=${HOOK_ID%%.*}
# shellcheck disable=SC2155 # No way to assign to readonly variable in separate lines
readonly SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# shellcheck source=_common.sh