Re: [PATCH v1] travis-ci: override CFLAGS properly, add -Wdeclaration-after-statement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jeff King <peff@xxxxxxxx> writes:

> Perhaps. I'm not sure that people actually use checkpatch.pl for git.
>
> Out of curiosity, I tried:
>
>   mkdir out
>   git format-patch -o out v2.6.0..v2.7.0
>   checkpatch.pl out/*
>
> It's rather noisy, and after skimming, I'd say (subjectively) that only
> a small fraction are actual style issues we try to enforce. So it would
> certainly need a fair bit of tweaking for regular use, I think.
>
> -Peff

FWIW, I use the attached (it assumes a recent kernel checkout at
certain location and checkpatch-original.pl being a symlink to it)
occasionally.  I found patches from some people are consistently
clean and suspect they may be running checkpatch themselves.

-- >8 -- Meta/CP (not on 'todo' branch) -- >8 --
#!/bin/sh

# Run checkpatch on the series
Meta=$(git rev-parse --show-cdup)Meta
cp0="$Meta/checkpatch-original.pl"
cp1="$Meta/checkpatch.pl"
tmp="/var/tmp/CP.$$"

mkdir "$tmp" || exit
trap 'rm -fr "$tmp"' 0

if	! test -f "$cp1" ||
	test "$cp0" -nt "$cp1"
then
	cat "$cp0" >"$cp1" &&
	(cd "$Meta" &&
patch -p1 <<\EOF
--- a/checkpatch.pl
+++ b/checkpatch.pl
@@ -282,6 +282,8 @@
 	Reviewed-by:|
 	Reported-by:|
 	Suggested-by:|
+	Helped-by:|
+	Mentored-by:|
 	To:|
 	Cc:
 )};
@@ -2338,7 +2340,7 @@
 
 # check for new typedefs, only function parameters and sparse annotations
 # make sense.
-		if ($line =~ /\btypedef\s/ &&
+		if (0 && $line =~ /\btypedef\s/ &&
 		    $line !~ /\btypedef\s+$Type\s*\(\s*\*?$Ident\s*\)\s*\(/ &&
 		    $line !~ /\btypedef\s+$Type\s+$Ident\s*\(/ &&
 		    $line !~ /\b$typeTypedefs\b/ &&
@@ -2607,8 +2609,7 @@
 
 				# No spaces for:
 				#   ->
-				#   :   when part of a bitfield
-				} elsif ($op eq '->' || $opv eq ':B') {
+				} elsif ($op eq '->') {
 					if ($ctx =~ /Wx.|.xW/) {
 						ERROR("SPACING",
 						      "spaces prohibited around that '$op' $at\n" . $hereptr);

EOF
)
fi || exit

cat "$@" | git mailsplit -b -o"$tmp" >/dev/null

for mail in "$tmp"/*
do
	(
		git mailinfo -k "$mail.msg" "$mail.patch" >"$mail.info" <"$mail"
		echo
		cat "$mail.msg"
		printf "%s\n" -- "---"
		cat "$mail.patch"
	) >"$mail.mbox"
	perl "$Meta/checkpatch.pl" $ignore --no-tree --max-line-length=120 "$mail.mbox" || {
		grep "Subject: " "$mail.info"
		printf "%s\n" -- "------------------------------------------------"
	}
done


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]