Skip to content

Commit

Permalink
Improvements to test-patch script (tucu)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/oozie/trunk@1443774 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Alejandro Abdelnur committed Feb 7, 2013
1 parent a14c2e0 commit d5dded4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions bin/test-patch
Expand Up @@ -132,6 +132,8 @@ updateJira() {
###############################################################################
cleanupAndExit() {
updateJira
echo "test-patch exit code: $1"
echo
exit $1
}
###############################################################################
Expand Down Expand Up @@ -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 "$?"
8 changes: 4 additions & 4 deletions bin/test-patch-05-patch-raw-analysis
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit d5dded4

Please sign in to comment.