Pull request 2302: upd-all
Squashed commit of the following: commit f920006277f39b74c803139af2a9039aa45effae Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri Nov 8 16:14:41 2024 +0300 all: fix pre-commit; upd dnsproxy commit 391f79b244348c6075f5ba0fccfb8882791bf3f1 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Nov 7 18:53:28 2024 +0300 scripts: imp install commit 35324db80b591831c32b7ea45930eefee82a6320 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Nov 7 18:20:23 2024 +0300 all: imp docs, scripts commit d2724cfaefdb8659efbdb5bf181a28721a909f07 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Thu Nov 7 17:26:23 2024 +0300 all: upd go, deps, tools, scripts
This commit is contained in:
@@ -3,19 +3,17 @@
|
||||
# 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: 5
|
||||
# AdGuard-Project-Version: 8
|
||||
|
||||
verbose="${VERBOSE:-0}"
|
||||
readonly verbose
|
||||
|
||||
if [ "$verbose" -gt '0' ]
|
||||
then
|
||||
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
|
||||
if [ "${EXIT_ON_ERROR:-1}" -eq '0' ]; then
|
||||
set +e
|
||||
else
|
||||
set -e
|
||||
@@ -32,19 +30,30 @@ set -f -u
|
||||
# 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" )"
|
||||
nl="$(printf '\n')"
|
||||
readonly nl
|
||||
|
||||
# NOTE: Adjust for your project.
|
||||
git ls-files\
|
||||
':!*.png'\
|
||||
':!*.tar.gz'\
|
||||
':!*.zip'\
|
||||
| while read -r f
|
||||
do
|
||||
final_byte="$( tail -c -1 "$f" )"
|
||||
if [ "$final_byte" != "$nl" ]
|
||||
then
|
||||
find . \
|
||||
-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' \
|
||||
-o -path '*/node_modules/*' \
|
||||
-o -path './.git/*' \
|
||||
-o -path './bin/*' \
|
||||
-o -path './build/*' \
|
||||
')' \
|
||||
| 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
|
||||
@@ -53,19 +62,26 @@ trailing_newlines() (
|
||||
# trailing_whitespace is a simple check that makes sure that there are no
|
||||
# trailing whitespace in plain-text files.
|
||||
trailing_whitespace() {
|
||||
# NOTE: Adjust for your project.
|
||||
git ls-files\
|
||||
':!*.bmp'\
|
||||
':!*.jpg'\
|
||||
':!*.mmdb'\
|
||||
':!*.png'\
|
||||
':!*.svg'\
|
||||
':!*.tar.gz'\
|
||||
':!*.webp'\
|
||||
':!*.zip'\
|
||||
| while read -r f
|
||||
do
|
||||
grep -e '[[:space:]]$' -n -- "$f"\
|
||||
find . \
|
||||
-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' \
|
||||
-o -path '*/node_modules/*' \
|
||||
-o -path './.git/*' \
|
||||
-o -path './bin/*' \
|
||||
-o -path './build/*' \
|
||||
')' \
|
||||
| while read -r f; do
|
||||
grep -e '[[:space:]]$' -n -- "$f" \
|
||||
| sed -e "s:^:${f}\::" -e 's/ \+$/>>>&<<</'
|
||||
done
|
||||
}
|
||||
@@ -74,7 +90,18 @@ run_linter -e trailing_newlines
|
||||
|
||||
run_linter -e trailing_whitespace
|
||||
|
||||
git ls-files -- '*.conf' '*.md' '*.txt' '*.yaml' '*.yml'\
|
||||
'client/src/__locales/en.json'\
|
||||
| xargs misspell --error\
|
||||
| sed -e 's/^/misspell: /'
|
||||
find . \
|
||||
-type 'f' \
|
||||
'!' '(' \
|
||||
-path '*/node_modules/*' \
|
||||
-o -path './data/filters/*' \
|
||||
')' \
|
||||
'(' \
|
||||
-name 'Makefile' \
|
||||
-o -name '*.conf' \
|
||||
-o -name '*.md' \
|
||||
-o -name '*.txt' \
|
||||
-o -name '*.yaml' \
|
||||
-o -name '*.yml' \
|
||||
')' \
|
||||
-exec 'misspell' '--error' '{}' '+'
|
||||
|
||||
Reference in New Issue
Block a user