mirror of
https://git.vectorsigma.ru/public/AdGuardHome.git
synced 2026-07-28 23:38:59 +00:00
Merge in DNS/adguard-home from upd-all to master Squashed commit of the following: commit 72a41e9e2d9b9a5fbf24fa69322f9c4dcf3f5fb7 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Aug 14 19:42:11 2025 +0300 specs: export tests commit aa729009306e492fd8a046b5e84f49be87e2a57f Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Aug 14 19:19:54 2025 +0300 all: upd golibs commit 526ce744cfdf167d1e5b763422092e6f450993a6 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Aug 14 17:21:57 2025 +0300 all: upd scripts commit ecc4312764b31e8b84e462321e3690a9b8eebbf6 Author: Eugene Burkov <E.Burkov@AdGuard.COM> Date: Thu Aug 14 17:02:53 2025 +0300 all: upd go & tools
98 lines
2.0 KiB
Bash
98 lines
2.0 KiB
Bash
#!/bin/sh
|
|
|
|
# This comment is used to simplify checking local copies of the script. Bump
|
|
# this number every time a remarkable change is made to this script.
|
|
#
|
|
# AdGuard-Project-Version: 9
|
|
|
|
verbose="${VERBOSE:-0}"
|
|
readonly verbose
|
|
|
|
if [ "$verbose" -gt '0' ]; then
|
|
set -x
|
|
fi
|
|
|
|
# Set $EXIT_ON_ERROR to zero to see all errors.
|
|
if [ "${EXIT_ON_ERROR:-1}" -eq '0' ]; then
|
|
set +e
|
|
else
|
|
set -e
|
|
fi
|
|
|
|
# We don't need glob expansions and we want to see errors about unset variables.
|
|
set -f -u
|
|
|
|
# Source the common helpers, including not_found.
|
|
. ./scripts/make/helper.sh
|
|
|
|
# Simple analyzers
|
|
|
|
# trailing_newlines is a simple check that makes sure that all plain-text files
|
|
# have a trailing newlines to make sure that all tools work correctly with them.
|
|
trailing_newlines() (
|
|
nl="$(printf '\n')"
|
|
readonly nl
|
|
|
|
find_with_ignore \
|
|
-type 'f' \
|
|
'!' '(' \
|
|
-name '*.db' \
|
|
-o -name '*.exe' \
|
|
-o -name '*.out' \
|
|
-o -name '*.png' \
|
|
-o -name '*.svg' \
|
|
-o -name '*.tar.gz' \
|
|
-o -name '*.test' \
|
|
-o -name '*.zip' \
|
|
-o -name 'AdGuardHome' \
|
|
-o -name 'adguard-home' \
|
|
')' \
|
|
-print \
|
|
| while read -r f; do
|
|
final_byte="$(tail -c -1 "$f")"
|
|
if [ "$final_byte" != "$nl" ]; then
|
|
printf '%s: must have a trailing newline\n' "$f"
|
|
fi
|
|
done
|
|
)
|
|
|
|
# trailing_whitespace is a simple check that makes sure that there are no
|
|
# trailing whitespace in plain-text files.
|
|
trailing_whitespace() {
|
|
find_with_ignore \
|
|
-type 'f' \
|
|
'!' '(' \
|
|
-name '*.db' \
|
|
-o -name '*.exe' \
|
|
-o -name '*.out' \
|
|
-o -name '*.png' \
|
|
-o -name '*.svg' \
|
|
-o -name '*.tar.gz' \
|
|
-o -name '*.test' \
|
|
-o -name '*.zip' \
|
|
-o -name 'AdGuardHome' \
|
|
-o -name 'adguard-home' \
|
|
')' \
|
|
-print \
|
|
| while read -r f; do
|
|
grep -e '[[:space:]]$' -n -- "$f" \
|
|
| sed -e "s:^:${f}\::" -e 's/ \+$/>>>&<<</'
|
|
done
|
|
}
|
|
|
|
run_linter -e trailing_newlines
|
|
|
|
run_linter -e trailing_whitespace
|
|
|
|
find_with_ignore \
|
|
-type 'f' \
|
|
'(' \
|
|
-name 'Makefile' \
|
|
-o -name '*.conf' \
|
|
-o -name '*.md' \
|
|
-o -name '*.txt' \
|
|
-o -name '*.yaml' \
|
|
-o -name '*.yml' \
|
|
')' \
|
|
-exec 'misspell' '--error' '{}' '+'
|