From d2d1678f136add8887ff9dc0c1232dedad0244a1 Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Wed, 18 Dec 2024 22:44:39 -0800 Subject: [PATCH] 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 --- Makefile | 6 +----- scripts/test.sh | 23 ----------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/Makefile b/Makefile index 3690c09bfc0..5bc74672768 100644 --- a/Makefile +++ b/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 diff --git a/scripts/test.sh b/scripts/test.sh index 2af3881f77d..75447c80b00 100755 --- a/scripts/test.sh +++ b/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 #