Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936629AbcJ1O6D (ORCPT ); Fri, 28 Oct 2016 10:58:03 -0400 Received: from smtprelay0083.hostedemail.com ([216.40.44.83]:33531 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932740AbcJ1O6B (ORCPT ); Fri, 28 Oct 2016 10:58:01 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 30,2,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1431:1437:1515:1516:1518:1534:1543:1593:1594:1605:1711:1730:1747:1777:1792:1801:2393:2559:2562:2828:2895:2910:2911:3138:3139:3140:3141:3142:3622:3653:3865:3866:3867:3868:3870:3871:3872:3874:4250:4321:4425:4605:5007:7903:8957:9040:9121:10004:10400:10848:11026:11232:11233:11473:11658:11914:12043:12305:12555:12740:12760:13095:13158:13228:13439:14181:14659:14721:21080:21433:21434:21451:21505:30054:30062:30070:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: pie12_62ba6abaef805 X-Filterd-Recvd-Size: 4284 Message-ID: <1477666677.7945.10.camel@perches.com> Subject: Re: [PATCH] scripts/checkpatch: Check for Reviewed-by under --strict From: Joe Perches To: Chris Wilson , linux-kernel@vger.kernel.org Cc: intel-gfx@lists.freedesktop.org, Andy Whitcroft , Joonas Lahtinen Date: Fri, 28 Oct 2016 07:57:57 -0700 In-Reply-To: <20161028124944.17930-1-chris@chris-wilson.co.uk> References: <20161028124944.17930-1-chris@chris-wilson.co.uk> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.1-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3325 Lines: 100 On Fri, 2016-10-28 at 13:49 +0100, Chris Wilson wrote: > Some subsystem polices have a strict requirement that every patch must > have at least one reviewer before being approved for upstream. Since > encouraging review is good policy (great review is even better policy!) > enforce checking for a Reviewed-by when checkpath is run with --strict > (or with --review). I rather dislike this as it imposes a rule outside of what's documented in SubmittingPatches. Ideally, please keep a private version of this. And unless and until SubmittingPatches is updated, please keep this separate from --strict. > Signed-off-by: Chris Wilson > Cc: Andy Whitcroft > Cc: Joe Perches > Cc: Joonas Lahtinen > --- > scripts/checkpatch.pl | 17 ++++++++++++++++- > 1 file changed, 16 insertions(+), 1 deletion(-) > > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > index a8368d1c4348..9eaa5a4fbbc0 100755 > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -21,6 +21,7 @@ use Getopt::Long qw(:config no_auto_abbrev); > my $quiet = 0; > my $tree = 1; > my $chk_signoff = 1; > +my $chk_review = 0; > my $chk_patch = 1; > my $tst_only; > my $emacs = 0; > @@ -69,6 +70,7 @@ Options: > -q, --quiet quiet > --no-tree run without a kernel tree > --no-signoff do not check for 'Signed-off-by' line > + --review check for 'Reviewed-by' line > --patch treat FILE as patchfile (default) > --emacs emacs compile window format > --terse one line per report > @@ -183,6 +185,7 @@ GetOptions( > 'q|quiet+' => \$quiet, > 'tree!' => \$tree, > 'signoff!' => \$chk_signoff, > + 'review!' => \$chk_review, > 'patch!' => \$chk_patch, > 'emacs!' => \$emacs, > 'terse!' => \$terse, > @@ -217,7 +220,7 @@ help(0) if ($help); > > list_types(0) if ($list_types); > > -$fix = 1 if ($fix_inplace); > +$chk_review = 1 if ($check); # --strict implies checking for Reviewed-by > $check_orig = $check; > > my $exit = 0; > @@ -857,6 +860,7 @@ sub git_commit_info { > } > > $chk_signoff = 0 if ($file); > +$chk_review = 0 if ($file); > > my @rawlines = (); > my @lines = (); > @@ -2130,6 +2134,7 @@ sub process { > > our $clean = 1; > my $signoff = 0; > + my $review = 0; > my $is_patch = 0; > my $in_header_lines = $file ? 0 : 1; > my $in_commit_log = 0; #Scanning lines before patch > @@ -2400,6 +2405,12 @@ sub process { > $in_commit_log = 0; > } > > +# Check the patch for any review: > + if ($line =~ /^\s*reviewed-by:/i) { > + $review++; > + $in_commit_log = 0; > + } > + > # Check if MAINTAINERS is being updated. If so, there's probably no need to > # emit the "does MAINTAINERS need updating?" message on file add/move/delete > if ($line =~ /^\s*MAINTAINERS\s*\|/) { > @@ -6204,6 +6215,10 @@ sub process { > ERROR("MISSING_SIGN_OFF", > "Missing Signed-off-by: line(s)\n"); > } > + if ($is_patch && $has_commit_log && $chk_review && $review == 0) { > + ERROR("MISSING_REVIEW", > + "Missing Reviewed-by: line(s)\n"); > + } > > print report_dump(); > if ($summary && !($clean == 1 && $quiet == 1)) {