mirror of
https://github.com/AdguardTeam/AdGuardHome.git
synced 2026-06-28 11:51:22 +00:00
Pull request 2610: ADG-11715-all-update-skel
Squashed commit of the following:
commit cdb69ce8590c68a77b6d2118cc5df671f4cfcce2
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date: Thu Mar 19 12:42:08 2026 +0300
make: rollback redundant changes;
commit 1b7ef9f887b223e8d689fdec8b2595dc2802d2df
Author: Maksim Kazantsev <m.kazantsev@adguard.com>
Date: Thu Mar 19 12:39:28 2026 +0300
make: upd scripts
This commit is contained in:
parent
8acac6f183
commit
d7b6dc0cf7
6 changed files with 49 additions and 27 deletions
|
|
@ -8,4 +8,4 @@ trackers_url='https://raw.githubusercontent.com/AdguardTeam/companiesdb/main/dis
|
|||
output='./client/src/helpers/trackers/trackers.json'
|
||||
readonly trackers_url output
|
||||
|
||||
curl -v "$trackers_url" | jq . > "$output"
|
||||
curl -v "$trackers_url" | jq . >"$output"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
# 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: 1
|
||||
# AdGuard-Project-Version: 3
|
||||
|
||||
# Only show interactive prompts if there a terminal is attached to stdout.
|
||||
# While this technically doesn't guarantee that reading from /dev/tty works,
|
||||
|
|
@ -80,7 +80,20 @@ lint_staged_changes() {
|
|||
make VERBOSE="$verbose" sh-lint
|
||||
fi
|
||||
|
||||
txt_diff="$(git diff --cached --name-only -- '*.md' '*.yaml' '*.yml' 'Makefile' '*.json' || :)"
|
||||
txt_diff="$(
|
||||
git \
|
||||
diff \
|
||||
--cached \
|
||||
--name-only \
|
||||
-- \
|
||||
'*.json' \
|
||||
'*.md' \
|
||||
'*.yaml' \
|
||||
'*.yml' \
|
||||
'*.dockerignore' \
|
||||
'.gitignore' \
|
||||
'Makefile' || :
|
||||
)"
|
||||
readonly txt_diff
|
||||
|
||||
if [ "$txt_diff" != '' ]; then
|
||||
|
|
@ -90,5 +103,4 @@ lint_staged_changes() {
|
|||
if [ "$(git diff --cached --name-only -- '*.go' '*.mod' 'Makefile' || :)" != '' ]; then
|
||||
make VERBOSE="$verbose" go-os-check go-lint go-test
|
||||
fi
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# 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: 17
|
||||
# AdGuard-Project-Version: 18
|
||||
|
||||
verbose="${VERBOSE:-0}"
|
||||
readonly verbose
|
||||
|
|
@ -164,7 +164,7 @@ run_linter -e underscores
|
|||
|
||||
run_linter -e "$go" tool gofumpt --extra -e -l .
|
||||
|
||||
run_linter "${GO:-go}" vet ./...
|
||||
run_linter "${GO:-go}" vet work
|
||||
|
||||
# govulncheck is not stricly reproducible, because it queries the VulnDB, which
|
||||
# is updated constantly. If a stricly reproducible lint is desired, for example
|
||||
|
|
@ -220,9 +220,9 @@ run_linter "$go" tool gocognit --over='10' \
|
|||
./scripts/ \
|
||||
;
|
||||
|
||||
run_linter "$go" tool ineffassign ./...
|
||||
run_linter "$go" tool ineffassign work
|
||||
|
||||
run_linter "$go" tool unparam ./...
|
||||
run_linter "$go" tool unparam work
|
||||
|
||||
find_with_ignore \
|
||||
-type 'f' \
|
||||
|
|
@ -237,7 +237,7 @@ find_with_ignore \
|
|||
')' \
|
||||
-exec "$go" 'tool' 'misspell' '--error' '{}' '+'
|
||||
|
||||
run_linter "$go" tool nilness ./...
|
||||
run_linter "$go" tool nilness work
|
||||
|
||||
# TODO(a.garipov): Enable for all.
|
||||
run_linter "$go" tool fieldalignment \
|
||||
|
|
@ -268,7 +268,7 @@ run_linter "$go" tool fieldalignment \
|
|||
./internal/whois/ \
|
||||
;
|
||||
|
||||
run_linter -e "$go" tool shadow --strict ./...
|
||||
run_linter -e "$go" tool shadow --strict work
|
||||
|
||||
# TODO(a.garipov): Enable for all.
|
||||
# TODO(e.burkov): Re-enable G115.
|
||||
|
|
@ -300,15 +300,12 @@ run_linter "$go" tool gosec --exclude=G115 --fmt=golint --quiet \
|
|||
./internal/whois/ \
|
||||
;
|
||||
|
||||
run_linter "$go" tool errcheck ./...
|
||||
run_linter "$go" tool errcheck work
|
||||
|
||||
staticcheck_matrix='
|
||||
darwin: GOOS=darwin
|
||||
freebsd: GOOS=freebsd
|
||||
linux: GOOS=linux
|
||||
openbsd: GOOS=openbsd
|
||||
windows: GOOS=windows
|
||||
'
|
||||
readonly staticcheck_matrix
|
||||
|
||||
printf '%s' "$staticcheck_matrix" | run_linter "$go" tool staticcheck --matrix ./...
|
||||
run_linter "$go" tool staticcheck --matrix work <<-'EOF'
|
||||
darwin: GOOS=darwin
|
||||
freebsd: GOOS=freebsd
|
||||
linux: GOOS=linux
|
||||
openbsd: GOOS=openbsd
|
||||
windows: GOOS=windows
|
||||
EOF
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
# 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: 7
|
||||
# AdGuard-Project-Version: 8
|
||||
|
||||
verbose="${VERBOSE:-0}"
|
||||
readonly verbose
|
||||
|
|
@ -52,7 +52,8 @@ go_test() {
|
|||
"$timeout_flags" \
|
||||
"$v_flags" \
|
||||
"$x_flags" \
|
||||
./...
|
||||
work \
|
||||
;
|
||||
}
|
||||
|
||||
test_reports_dir="${TEST_REPORTS_DIR:-}"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
# 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
|
||||
# AdGuard-Project-Version: 7
|
||||
|
||||
# Deferred helpers
|
||||
|
||||
|
|
@ -57,13 +57,24 @@ run_linter() (
|
|||
|
||||
readonly cmd
|
||||
|
||||
output="$("$cmd" "$@")"
|
||||
output="$("$cmd" "$@" 2>&1)"
|
||||
exitcode="$?"
|
||||
|
||||
readonly output
|
||||
|
||||
if [ "$output" != '' ]; then
|
||||
echo "$output" | sed -e "s/^/${cmd}: /"
|
||||
# Print the correct prefix for linter output. For example, print the
|
||||
# tool name for a "go tool" call, or "vet" for a "go vet" call.
|
||||
prefix="$cmd"
|
||||
if [ "$#" -ge '3' ] && [ "$1" = 'tool' ]; then
|
||||
prefix="$2"
|
||||
elif [ "$#" -ge '2' ] && [ "$1" = 'vet' ]; then
|
||||
prefix="$1"
|
||||
fi
|
||||
|
||||
readonly prefix
|
||||
|
||||
echo "$output" | sed -e "s/^/${prefix}: /"
|
||||
|
||||
if [ "$exitcode" -eq '0' ] && [ "$exit_on_output" -eq '1' ]; then
|
||||
exitcode='1'
|
||||
|
|
|
|||
|
|
@ -127,4 +127,5 @@ find_with_ignore \
|
|||
-o -name '*.yaml' \
|
||||
-o -name '*.yml' \
|
||||
')' \
|
||||
-exec "$go" 'tool' 'misspell' '--error' '{}' '+'
|
||||
-exec "$go" 'tool' 'misspell' '--error' '{}' '+' \
|
||||
;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue