From patchwork Tue Oct 10 22:44:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parav Pandit X-Patchwork-Id: 9998093 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 577BE60230 for ; Tue, 10 Oct 2017 22:44:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 493A4287FF for ; Tue, 10 Oct 2017 22:44:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CE5C28801; Tue, 10 Oct 2017 22:44:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60E83287FF for ; Tue, 10 Oct 2017 22:44:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756502AbdJJWow (ORCPT ); Tue, 10 Oct 2017 18:44:52 -0400 Received: from mail-il-dmz.mellanox.com ([193.47.165.129]:35462 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755951AbdJJWoq (ORCPT ); Tue, 10 Oct 2017 18:44:46 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from parav@mellanox.com) with ESMTPS (AES256-SHA encrypted); 11 Oct 2017 00:44:43 +0200 Received: from sw-mtx-036.mtx.labs.mlnx (sw-mtx-036.mtx.labs.mlnx [10.12.150.149]) by labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v9AMifKm016193; Wed, 11 Oct 2017 01:44:41 +0300 From: Parav Pandit To: joe@perches.com, apw@canonical.com Cc: linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, parav@mellanox.com, Brad Erickson Subject: [PATCH] checkpatch: Introduce check for format of Fixes line in commit log Date: Tue, 10 Oct 2017 17:44:27 -0500 Message-Id: <1507675467-24316-1-git-send-email-parav@mellanox.com> X-Mailer: git-send-email 1.8.3.1 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch introduces a format check for 'Fixes' line in commit log for 12 characters commit id and format for Fixes as ("..."). Its created against linux-rdma Doug's tree [1]. [1] git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma.git Signed-off-by: Parav Pandit Signed-off-by: Brad Erickson --- scripts/checkpatch.pl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index dd2c262..7d933e4 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2548,6 +2548,14 @@ sub process { "Remove Gerrit Change-Id's before submitting upstream.\n" . $herecurr); } +# Check for incorrect format for Fixes line in commit log + if ($in_commit_log && $line =~ /^\s*Fixes:/i) { + if ($line !~ /^\s*Fixes: [a-z0-9]{12} \(\".*?\"\)$/i) { + ERROR("FIXES_FORMAT", + "Follow format of Fixes: <12 characters commit id> (\"...\")\n" . $herecurr); + } + } + # Check if the commit log is in a possible stack dump if ($in_commit_log && !$commit_log_possible_stack_dump && ($line =~ /^\s*(?:WARNING:|BUG:)/ ||