This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] check_GNU_style.sh "80 characters exceeded" error fix


check_GNU_style.sh error "Lines should not exceed 80 characters" does not return the file name and line number where error is present,
only the line of code. Whereas other kind of errors return full information.

This small patch will fix this and make check_GNU_style.sh return full information when patch contains lines longer than 80 errors.

Tested on patches containing >80 chars lines and the script produces full information as necessary.

Would this be a useful enhancement for trunk?

Mantas Mikaitis

gcc/ChangeLog:

         * contrib/check_GNU_style.sh (col): Got rid of cut operation
           from the pipe chain and instead added cut inside awk command.



diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh
index ef8fdda..c405eeb 100755
--- a/contrib/check_GNU_style.sh
+++ b/contrib/check_GNU_style.sh
@@ -86,8 +86,7 @@ col (){
     shift 1
     grep -nH '^+' $* \
 	| grep -v ':+++' \
-	| cut -f 2 -d '+' \
-	| awk '{ if (length ($0) > 80) print $0 }' \
+	| awk -F':\\+' '{ if (length($2) > 80) print $0}' \
 	> $tmp
     if [ -s $tmp ]; then
 	printf "\n$msg\n"

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]