You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@calcite.apache.org by fr...@apache.org on 2022/10/10 02:13:23 UTC

[calcite-avatica-go] 02/04: [CALCITE-5325] Display errors when failing release guidelines check using docker release script

This is an automated email from the ASF dual-hosted git repository.

francischuang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/calcite-avatica-go.git

commit 9876f6fff70b034e4ba0592cfb99292c6d79863a
Author: Francis Chuang <fr...@apache.org>
AuthorDate: Mon Oct 10 10:53:51 2022 +1100

    [CALCITE-5325] Display errors when failing release guidelines check using docker release script
---
 docker.sh | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/docker.sh b/docker.sh
index 76b079a..b428f5d 100755
--- a/docker.sh
+++ b/docker.sh
@@ -163,6 +163,8 @@ select_gpg_key(){
 check_release_guidelines(){
 
     # Exclude files without the Apache license header
+    missingHeaders=0
+
     for i in $(git ls-files); do
        case "$i" in
        # The following are excluded from the license header check
@@ -176,7 +178,9 @@ check_release_guidelines(){
        # Binaries
        (test-fixtures/calcite.png);;
 
-       (*) grep -q "Licensed to the Apache Software Foundation" $i || echo "$i has no header";;
+       (*) if ! grep -q "Licensed to the Apache Software Foundation" $i; then
+             echo "$i has no header" && ((missingHeaders=missingHeaders+1))
+           fi;;
        esac
     done
 
@@ -185,6 +189,11 @@ check_release_guidelines(){
         echo "Ending copyright year in NOTICE is not $(date +%Y)"
         exit 1
     fi
+
+    if [[ $missingHeaders -gt 0 ]]; then
+        echo "Some files are missing the Apache license header"
+        exit 1
+    fi
 }
 
 check_if_tag_exists(){