Permalink
Browse files

Improvements to test-patch script (tucu)

git-svn-id: https://svn.apache.org/repos/asf/oozie/trunk@1443774 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent a14c2e0 commit d5dded41a3cfae11c667494f9bde57b31b34113e Alejandro Abdelnur committed Feb 7, 2013
Showing with 8 additions and 6 deletions.
  1. +4 −2 bin/test-patch
  2. +4 −4 bin/test-patch-05-patch-raw-analysis
View
@@ -132,6 +132,8 @@ updateJira() {
###############################################################################
cleanupAndExit() {
updateJira
+ echo "test-patch exit code: $1"
+ echo
exit $1
}
###############################################################################
@@ -407,5 +409,5 @@ cat ${SUMMARYFILE} | sed -e 's/{color}//' -e 's/{color:green}//' -e 's/{color:re
cat ${SUMMARYFILETXT}
-grep "\-1" ${SUMMARYFILE} &> /dev/null
-cleanupAndExit `expr $? = 0`
+grep "^+1 Overall result" ${SUMMARYFILETXT} &> /dev/null
+cleanupAndExit "$?"
@@ -74,7 +74,7 @@ parseArgs() {
}
###############################################################################
checkNoAuthors() {
- authorTags=`grep "^+ " ${PATCHFILE} | grep -c -i -e ".*\*.* @author"`
+ authorTags=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c -i -e ".*\*.* @author"`
if [[ ${authorTags} != 0 ]] ; then
REPORT+=("{color:red}-1{color} the patch seems to contain ${authorTags} line(s) with @author tags")
else
@@ -83,7 +83,7 @@ checkNoAuthors() {
}
###############################################################################
checkNoTabs() {
- tabs=`grep "^+ " ${PATCHFILE} | grep -c -P "\t"`
+ tabs=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c $'\t'`
if [[ ${tabs} != 0 ]] ; then
REPORT+=("{color:red}-1{color} the patch contains ${tabs} line(s) with tabs")
else
@@ -92,7 +92,7 @@ checkNoTabs() {
}
###############################################################################
checkNoTrailingSpaces() {
- trailingSpaces=`grep "^+ " ${PATCHFILE} | grep -c -e " $"`
+ trailingSpaces=`grep "^+" ${PATCHFILE} | grep -v "^+++" | grep -c -e " $"`
if [[ ${trailingSpaces} != 0 ]] ; then
REPORT+=("{color:red}-1{color} the patch contains ${trailingSpaces} line(s) with trailing spaces")
else
@@ -102,7 +102,7 @@ checkNoTrailingSpaces() {
###############################################################################
checkLinesLength() {
# We check for > 133 to account for the "+" sign
- longLines=`grep "^+ " ${PATCHFILE} | awk 'BEGIN{count=0}{if ( length > 133 ) { count=count+1} }END{ print count}'`
+ longLines=`grep "^+" ${PATCHFILE} | grep -v "^+++" | awk 'BEGIN{count=0}{if ( length > 133 ) { count=count+1} }END{ print count}'`
if [[ ${longLines} != 0 ]] ; then
REPORT+=("{color:red}-1{color} the patch contains ${longLines} line(s) longer than 132 characters")
else

0 comments on commit d5dded4

Please sign in to comment.