scripts: remove receiver name check

This check is duplicated as the project uses revive's receiver-naming,
which is more robust, as the current check may have false positives.

Signed-off-by: Ivan Valdes <ivan@vald.es>
This commit is contained in:
Ivan Valdes 2024-12-18 22:44:39 -08:00
parent b53107151a
commit d2d1678f13
No known key found for this signature in database
GPG Key ID: 4037D37741ED0CC5
2 changed files with 1 additions and 28 deletions

View File

@ -65,7 +65,7 @@ fuzz:
# Static analysis # Static analysis
.PHONY: verify .PHONY: verify
verify: verify-gofmt verify-bom verify-lint verify-dep verify-shellcheck verify-goword \ verify: verify-gofmt verify-bom verify-lint verify-dep verify-shellcheck verify-goword \
verify-govet verify-license-header verify-receiver-name verify-mod-tidy \ verify-govet verify-license-header verify-mod-tidy \
verify-shellws verify-proto-annotations verify-genproto verify-yamllint \ verify-shellws verify-proto-annotations verify-genproto verify-yamllint \
verify-govet-shadow verify-markdown-marker verify-go-versions verify-govet-shadow verify-markdown-marker verify-go-versions
@ -113,10 +113,6 @@ verify-govet:
verify-license-header: verify-license-header:
PASSES="license_header" ./scripts/test.sh PASSES="license_header" ./scripts/test.sh
.PHONY: verify-receiver-name
verify-receiver-name:
PASSES="receiver_name" ./scripts/test.sh
.PHONY: verify-mod-tidy .PHONY: verify-mod-tidy
verify-mod-tidy: verify-mod-tidy:
PASSES="mod_tidy" ./scripts/test.sh PASSES="mod_tidy" ./scripts/test.sh

View File

@ -433,29 +433,6 @@ function license_header_pass {
run_for_modules generic_checker license_header_per_module run_for_modules generic_checker license_header_per_module
} }
function receiver_name_for_package {
# bash 3.x compatible replacement of: mapfile -t gofiles < <(go_srcs_in_module)
local gofiles=()
while IFS= read -r line; do gofiles+=("$line"); done < <(go_srcs_in_module)
recvs=$(grep 'func ([^*]' "${gofiles[@]}" | tr ':' ' ' | \
awk ' { print $2" "$3" "$4" "$1 }' | sed "s/[a-zA-Z\\.]*go//g" | sort | uniq | \
grep -Ev "(Descriptor|Proto|_)" | awk ' { print $3" "$4 } ' | sort | uniq -c | grep -v ' 1 ' | awk ' { print $2 } ')
if [ -n "${recvs}" ]; then
# shellcheck disable=SC2206
recvs=($recvs)
for recv in "${recvs[@]}"; do
log_error "Mismatched receiver for $recv..."
grep "$recv" "${gofiles[@]}" | grep 'func ('
done
return 255
fi
}
function receiver_name_pass {
run_for_modules receiver_name_for_package
}
# goword_for_package package # goword_for_package package
# checks spelling and comments in the 'package' in the current module # checks spelling and comments in the 'package' in the current module
# #