Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1464536imm; Wed, 25 Jul 2018 19:24:31 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcDL/m4DYiY9ZY6vLnphNFkmAW8XWj8L5OJUgdePnI2IlLo3iGEkejgjrxcM6tKGXgqzWcx X-Received: by 2002:a17:902:24e:: with SMTP id 72-v6mr102856plc.74.1532571871601; Wed, 25 Jul 2018 19:24:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532571871; cv=none; d=google.com; s=arc-20160816; b=f0ZEtAoCN42IIlqXDKWAEThmaEkUaJZAOe08n2XWzO2Dm5vstj4XQIsghw/0dP3NWx mi/K9QcGFEUNaS/QBJ05n22TQ64VHgacaRWtKQjLQnMg3PvlTQdglbxQaI1/zVAHNuQL xh9ldjH6NEkwXTeLrXfLx7s/vyuKcIhJBQuwGDC2wAg0jOD6e6SsIwOLz2r4O63UGJoS hJdwkVZBqSL9cNFKqSyi+2GXwM/6CeWzoQMvt767Bp57gpcl+FbovIKZWJwgycggugeV M/TyGXBuA50q8NSY/n/L3hpxYg4dbGYso6OKuFZpUZ1WfeyJ0BL3Be5sBuwxC+U+vXVX YlQw== 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:date:cc:to:from:subject:message-id :arc-authentication-results; bh=F18Wjp+6zdeTOUM9SOgq92ggLhQ7WDea9BQup4vh1S8=; b=0EZMz7/t0iW3PcTqUDu34vxHEdkkaXRRWG6qu0+gGDkv1vafcDCuOFDpD7bUZZs+Hm xLKA1fRml3HWNe11wwJ2VITCbuOc8BmSVWwcZTkje14kbb6a10Z7vWkq8o8H0GrhPGsB T+FYi0OcWmDxrofRaswXCyTdKBzhaETXP8vc9EDPmzvlgIEvQ6YIz1drs18xvlEZuj3k p+Uc/vPseOfTVk+PPiwxed/JpXziPQ6qyx+J9TJ03is8mrLqz6a03p9Ahp0uQx8iFWKp Mqwd+DhKt3i1D9JRC65Le0oTqpQe60A6T/HhSAz4g4AR5jeMVa+eBRWyp0PGp8nzIBd4 /V1Q== 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 i8-v6si124227pgj.33.2018.07.25.19.24.16; Wed, 25 Jul 2018 19:24:31 -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 S1728756AbeGZDhX (ORCPT + 99 others); Wed, 25 Jul 2018 23:37:23 -0400 Received: from smtprelay0156.hostedemail.com ([216.40.44.156]:45419 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728529AbeGZDhW (ORCPT ); Wed, 25 Jul 2018 23:37:22 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 1987A100E86C4; Thu, 26 Jul 2018 02:22:51 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:800:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:2915:3138:3139:3140:3141:3142:3352:3653:3865:3866:3870:3871:4321:5007:10004:10400:10848:11026:11658:11914:12043:12048:12438:12555:12760:13069:13153:13228:13311:13357:13439:14181:14394:14659:14721:21060:21080:21433:21451:21627:30034:30054:30069:30070,0,RBL:172.58.19.150:@perches.com:.lbl8.mailshell.net-62.8.0.190 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:26,LUA_SUMMARY:none X-HE-Tag: kitty74_6fe0c62c84a56 X-Filterd-Recvd-Size: 2622 Received: from XPS-9350 (unknown [172.58.19.150]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Thu, 26 Jul 2018 02:22:48 +0000 (UTC) Message-ID: <1b099f4d8373aa583a17011992676bf0f3f09eee.camel@perches.com> Subject: [PATCH] checkpatch: Warn when a patch doesn't have a description From: Joe Perches To: Prakruthi Deepak Heragu , Andrew Morton , Greg KH , Andy Whitcroft Cc: linux-kernel@vger.kernel.org, tsoni@codeaurora.org, bryanh@codeaurora.org, ckadabi@codeaurora.org, David Keitel Date: Wed, 25 Jul 2018 19:22:47 -0700 In-Reply-To: <6ed46f85a7577e1d4a48e81f67fd7581@codeaurora.org> References: <1531518027-13318-1-git-send-email-pheragu@codeaurora.org> <6799952fbd3639c764c112bde961b5e00270a52d.camel@perches.com> <6ed46f85a7577e1d4a48e81f67fd7581@codeaurora.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Potential patches should have a commit description. Emit a warning when there isn't one. Suggested-by: Prakruthi Deepak Heragu Signed-off-by: Joe Perches --- scripts/checkpatch.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b5c875d7132b..8b5f3dae31c9 100755 --- 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/]+@ &&