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:
parent
b53107151a
commit
d2d1678f13
6
Makefile
6
Makefile
@ -65,7 +65,7 @@ fuzz:
|
||||
# Static analysis
|
||||
.PHONY: verify
|
||||
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-govet-shadow verify-markdown-marker verify-go-versions
|
||||
|
||||
@ -113,10 +113,6 @@ verify-govet:
|
||||
verify-license-header:
|
||||
PASSES="license_header" ./scripts/test.sh
|
||||
|
||||
.PHONY: verify-receiver-name
|
||||
verify-receiver-name:
|
||||
PASSES="receiver_name" ./scripts/test.sh
|
||||
|
||||
.PHONY: verify-mod-tidy
|
||||
verify-mod-tidy:
|
||||
PASSES="mod_tidy" ./scripts/test.sh
|
||||
|
@ -433,29 +433,6 @@ function license_header_pass {
|
||||
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
|
||||
# checks spelling and comments in the 'package' in the current module
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user