From 43941f7bb532b5062797b47dbe43f504ec655f01 Mon Sep 17 00:00:00 2001 From: Ekrem Seren Date: Tue, 3 Dec 2024 16:45:48 +0300 Subject: [PATCH] reverse the order of the reported service tags --- scripts/analyze-service-tags.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/scripts/analyze-service-tags.sh b/scripts/analyze-service-tags.sh index 51ca220..d5be657 100755 --- a/scripts/analyze-service-tags.sh +++ b/scripts/analyze-service-tags.sh @@ -215,15 +215,14 @@ fi scan_proto_files "$1" # Print results -echo -e "\n${RED}${ERROR} Services without @custom:cmp-service tag:${NC}" +echo -e "\n${LGREEN}${SUCCESS} Services with valid @custom:cmp-service tag:${NC}" echo "=================================================" -if [ ${#no_tag_services[@]} -eq 0 ]; then - echo -e " ${INFO} No services found without tags" +if [ ${#valid_tag_services[@]} -eq 0 ]; then + echo -e " ${INFO} No services found with valid tags" else - for service in "${no_tag_services[@]}"; do + for service in "${valid_tag_services[@]}"; do format_service_output "$service" done - EXIT_CODE=1 fi echo -e "\n${BYELLOW}${WARNING} Services with invalid @custom:cmp-service tag:${NC}" @@ -239,21 +238,22 @@ else EXIT_CODE=1 fi -echo -e "\n${LGREEN}${SUCCESS} Services with valid @custom:cmp-service tag:${NC}" +echo -e "\n${RED}${ERROR} Services without @custom:cmp-service tag:${NC}" echo "=================================================" -if [ ${#valid_tag_services[@]} -eq 0 ]; then - echo -e " ${INFO} No services found with valid tags" +if [ ${#no_tag_services[@]} -eq 0 ]; then + echo -e " ${INFO} No services found without tags" else - for service in "${valid_tag_services[@]}"; do + for service in "${no_tag_services[@]}"; do format_service_output "$service" done + EXIT_CODE=1 fi # Print summary echo -e "\n${BLUE}${INFO} Summary:${NC}" echo "=================================================" -echo -e "${RED}${ERROR} Missing tags: ${#no_tag_services[@]}${NC}" -echo -e "${YELLOW}${WARNING} Invalid tags: ${#invalid_tag_services[@]}${NC}" -echo -e "${GREEN}${SUCCESS} Valid tags: ${#valid_tag_services[@]}${NC}" echo -e "Total services: $((${#no_tag_services[@]} + ${#invalid_tag_services[@]} + ${#valid_tag_services[@]}))" +echo -e "${GREEN}${SUCCESS} Valid tags: ${#valid_tag_services[@]}${NC}" +echo -e "${YELLOW}${WARNING} Invalid tags: ${#invalid_tag_services[@]}${NC}" +echo -e "${RED}${ERROR} Missing tags: ${#no_tag_services[@]}${NC}" exit $EXIT_CODE