From 1ef091688a329479e0655fbe491520060fea7972 Mon Sep 17 00:00:00 2001 From: Christian Richter Date: Tue, 13 Feb 2024 08:49:58 +0100 Subject: [PATCH] move semver regex to a dedicated variable Signed-off-by: Christian Richter --- .make/check-env-var-annotations.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.make/check-env-var-annotations.sh b/.make/check-env-var-annotations.sh index 173b79d03b..ffccfb8cf4 100755 --- a/.make/check-env-var-annotations.sh +++ b/.make/check-env-var-annotations.sh @@ -22,7 +22,9 @@ ERROR=0 -QUERY_INTRO=$(git grep "env:" -- '*.go' |grep -v -P "introductionVersion:\"([0-9.]{3,}([-].*)?|(pre5\.0))\""|grep -v "_test.go"|grep -v "vendor/") +SEMVER_REGEX="([0-9]|[1-9][0-9]*)(\.([0-9]|[1-9][0-9]*)){1,2}(?:-([0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*))?(?:\+[0-9A-Za-z-]+)?" + +QUERY_INTRO=$(git grep "env:" -- '*.go' |grep -v -P "introductionVersion:\"($SEMVER_REGEX|(pre5\.0))\""|grep -v "_test.go"|grep -v "vendor/") RESULTS_INTRO=$(echo "${QUERY_INTRO}"|wc -l) if [ "${RESULTS_INTRO}" -gt 0 ]; then