Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp120137imm; Thu, 26 Jul 2018 15:10:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdRRJg+W9HjT95qka6SU6Bx855Lw6/shksgs7ndP6733ELegGqodq7LBVnY/0Il7wuAZYdt X-Received: by 2002:a63:5b51:: with SMTP id l17-v6mr3439257pgm.165.1532643012221; Thu, 26 Jul 2018 15:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532643012; cv=none; d=google.com; s=arc-20160816; b=BE0rNLDhERFam12j8n91VyQvzg+nN/OjGXMeDwpqNPJ4VBQWiw1U29KNmfKbBrFig8 9FurqLBMWZoUExglLfZU/deNv53aJdHlxEyiYGMclgT3u4SACBNG7yqGUHLPZkR1T+PU sXymwAU8l2LALf3UvCvDXMYHPUFQRd5CP9Q1uvEshKIjXvgD4B6Z/1/O5r4+0Rkebb14 Bg/3vs43a2JZJYNzKg6bAVBKNG1LURmNsDrQ8201zPEXdH3HzM4+4m6Fd/mdPCobfkQp o35RnGmELYWmo2fawfCCMa53AgEMrFQAiFCaT6fpmUtj9a9JTeveb3gPJZ7+FQISHHOr 6yQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=Ot6Kx04EMa5xHBeezrRwTmrFGcQUf8EEh7YdYO8SwbY=; b=kO5q9WoYVHGzpa3HB5V7AdK6rhOaT0J6YAnzqYN0FkRo+n8Mwx5z5Qp0iIKKXdaMft JgPPcktsvVxv3gGyGGjUU6wjfQJkq+ket/RKvCQtnvjzCdiKLHMuUICjIga0y3cvp57I 3s6SJYwOSQ20PU9lp+bK2UK0WshXTzzgMYSdmtfTQc3WPaSpbXDFBwxA3ADFaXfflQeO 0OlRaLs1OgBev9roChPRNoGNn7Xd6sIvnlFJEy9iF/OelAx9YT1oyuqRv81DF/A8UYEF mez39Ps6xw0hm+BvquQfy5oabgRsxawuioFOXhuSzKBtpgOYcgAT5gGZJzRc273w0JOx LhgQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z62-v6si2029444pgz.640.2018.07.26.15.09.57; Thu, 26 Jul 2018 15:10:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731815AbeGZX1p (ORCPT + 99 others); Thu, 26 Jul 2018 19:27:45 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50558 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730989AbeGZX1o (ORCPT ); Thu, 26 Jul 2018 19:27:44 -0400 Received: from akpm3.svl.corp.google.com (unknown [104.133.9.92]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 071FC40B; Thu, 26 Jul 2018 22:08:57 +0000 (UTC) Date: Thu, 26 Jul 2018 15:08:55 -0700 From: Andrew Morton To: Joe Perches Cc: Prakruthi Deepak Heragu , Greg KH , Andy Whitcroft , linux-kernel@vger.kernel.org, tsoni@codeaurora.org, bryanh@codeaurora.org, ckadabi@codeaurora.org, David Keitel Subject: Re: [PATCH] checkpatch: Warn when a patch doesn't have a description Message-Id: <20180726150855.a9a3e81d5cdc4630c7f4ca2d@linux-foundation.org> In-Reply-To: <1b099f4d8373aa583a17011992676bf0f3f09eee.camel@perches.com> References: <1531518027-13318-1-git-send-email-pheragu@codeaurora.org> <6799952fbd3639c764c112bde961b5e00270a52d.camel@perches.com> <6ed46f85a7577e1d4a48e81f67fd7581@codeaurora.org> <1b099f4d8373aa583a17011992676bf0f3f09eee.camel@perches.com> X-Mailer: Sylpheed 3.6.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 25 Jul 2018 19:22:47 -0700 Joe Perches wrote: > Potential patches should have a commit description. > Emit a warning when there isn't one. > > ... > > --- a/scripts/checkpatch.pl > +++ b/scripts/checkpatch.pl > @@ -2240,6 +2240,7 @@ sub process { > my $in_header_lines = $file ? 0 : 1; > my $in_commit_log = 0; #Scanning lines before patch > my $has_commit_log = 0; #Encountered lines before patch > + my $commit_log_lines = 0; #Number of commit log lines > my $commit_log_possible_stack_dump = 0; > my $commit_log_long_line = 0; > my $commit_log_has_diff = 0; > @@ -2497,6 +2498,18 @@ sub process { > > $cnt_lines++ if ($realcnt != 0); > > +# Verify the existence of a commit log if appropriate > +# 2 is used because a $signature is counted in $commit_log_lines > + if ($in_commit_log) { > + if ($line !~ /^\s*$/) { > + $commit_log_lines++; #could be a $signature > + } > + } else if ($has_commit_log && $commit_log_lines < 2) { > + WARN("COMMIT_MESSAGE", > + "Missing commit description - Add an appropriate one\n"); > + $commit_log_lines = 2; #warn only once > + } > + > # Check if the commit log has what seems like a diff which can confuse patch > if ($in_commit_log && !$commit_log_has_diff && > (($line =~ m@^\s+diff\b.*a/[\w/]+@ && This explodes all over the place. Variable "$clean" is not imported at scripts/checkpatch.pl line 6565. Variable "$clean" is not imported at scripts/checkpatch.pl line 6590. Variable "$cnt_error" is not imported at scripts/checkpatch.pl line 6592. Variable "$cnt_warn" is not imported at scripts/checkpatch.pl line 6592. Variable "$cnt_chk" is not imported at scripts/checkpatch.pl line 6593. Variable "$cnt_lines" is not imported at scripts/checkpatch.pl line 6594. Variable "$clean" is not imported at scripts/checkpatch.pl line 6599. Variable "$clean" is not imported at scripts/checkpatch.pl line 6618. Variable "$clean" is not imported at scripts/checkpatch.pl line 6659. Variable "$clean" is not imported at scripts/checkpatch.pl line 6665. syntax error at scripts/checkpatch.pl line 2520, near "else if" Global symbol "$herecurr" requires explicit package name (did you forget to declare "my $herecurr"?) at scripts/checkpatch.pl line 2533. Global symbol "$herecurr" requires explicit package name (did you forget to declare "my $herecurr"?) at scripts/checkpatch.pl line 2584. Global symbol "$herecurr" requires explicit package name (did you forget to declare "my $herecurr"?) at scripts/checkpatch.pl line 2588. etc I did this: --- a/scripts/checkpatch.pl~checkpatch-warn-when-a-patch-doesnt-have-a-description-fix +++ a/scripts/checkpatch.pl @@ -2517,7 +2517,7 @@ sub process { if ($line !~ /^\s*$/) { $commit_log_lines++; #could be a $signature } - } else if ($has_commit_log && $commit_log_lines < 2) { + } elsif ($has_commit_log && $commit_log_lines < 2) { WARN("COMMIT_MESSAGE", "Missing commit description - Add an appropriate one\n"); $commit_log_lines = 2; #warn only once But I worry that you didn't send out the version which you tested, so please check.