Files
AdGuardDNS/scripts/hooks/pre-commit
Andrey Meshkov fa1ca77036 Sync v2.20
2026-02-28 10:50:25 +03:00

27 lines
645 B
Bash
Executable File

#!/bin/sh
# This comment is used to simplify checking local copies of the script. Bump
# this number every time a significant change is made to this script.
#
# AdGuard-Project-Version: 6
set -e -f -u
. ./scripts/hooks/helper.sh
# Warn the programmer about temporary todos and skel FIXMEs, but do not fail the
# commit, because the commit could be in a temporary branch.
temp_todos="$(
git grep -e 'FIXME' -e 'TODO.*!!' -- ':!scripts/hooks/pre-commit' || :
)"
readonly temp_todos
if [ "$temp_todos" != '' ]; then
printf 'WARNING: you have temporary todos:\n\n%s\n\n' "$temp_todos"
prompt
fi
check_unstaged_changes
lint_staged_changes