Browse Source

test: add license header check

Jonathan Boulle 10 years ago
parent
commit
108f97d63e
1 changed files with 10 additions and 0 deletions
  1. 10 0
      test

+ 10 - 0
test

@@ -83,4 +83,14 @@ for path in $FMT; do
 	fi
 done
 
+
+echo "Checking for license header..."
+licRes=$(for file in $(find . -type f -iname '*.go' ! -path './Godeps/*'); do
+		head -n3 "${file}" | grep -Eq "(Copyright|generated|GENERATED)" || echo -e "  ${file}"
+	done;)
+if [ -n "${licRes}" ]; then 
+	echo -e "license header checking failed:\n${licRes}"
+	exit 255
+fi
+
 echo "Success"