Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 750E6C64E7C for ; Wed, 2 Dec 2020 20:37:09 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 86B6721527 for ; Wed, 2 Dec 2020 20:37:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 86B6721527 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-kernel-mentees-bounces@lists.linuxfoundation.org Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E6BDD86D9D; Wed, 2 Dec 2020 20:37:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id N8TfPYiH_gKQ; Wed, 2 Dec 2020 20:37:05 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5EF3A86D8A; Wed, 2 Dec 2020 20:37:05 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 43CC3C163C; Wed, 2 Dec 2020 20:37:05 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists.linuxfoundation.org (Postfix) with ESMTP id 26BFDC0052 for ; Wed, 2 Dec 2020 20:37:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 110B887A3C for ; Wed, 2 Dec 2020 20:37:04 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YqiFbiDS+93u for ; Wed, 2 Dec 2020 20:37:02 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtprelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by hemlock.osuosl.org (Postfix) with ESMTPS id 1054987450 for ; Wed, 2 Dec 2020 20:37:01 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay04.hostedemail.com (Postfix) with ESMTP id 92772180A9F37; Wed, 2 Dec 2020 20:36:59 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: net61_25040e9273b6 X-Filterd-Recvd-Size: 1890 Received: from XPS-9350.home (unknown [47.151.128.180]) (Authenticated sender: joe@perches.com) by omf02.hostedemail.com (Postfix) with ESMTPA; Wed, 2 Dec 2020 20:36:58 +0000 (UTC) Message-ID: <0ae44ac0611db460faebda5380661f3b8cb80630.camel@perches.com> From: Joe Perches To: Dwaipayan Ray Date: Wed, 02 Dec 2020 12:36:57 -0800 In-Reply-To: <20201202202229.120898-1-dwaipayanray1@gmail.com> References: <20201202202229.120898-1-dwaipayanray1@gmail.com> User-Agent: Evolution 3.38.1-1 MIME-Version: 1.0 Cc: linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org, Peilin Ye Subject: Re: [Linux-kernel-mentees] [PATCH v2] checkpatch: add warning for lines starting with a '#' in commit log X-BeenThere: linux-kernel-mentees@lists.linuxfoundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-kernel-mentees-bounces@lists.linuxfoundation.org Sender: "Linux-kernel-mentees" On Thu, 2020-12-03 at 01:52 +0530, Dwaipayan Ray wrote: > Commit log lines starting with a '#' can be dropped by git if > the corresponding commit message is reworded by a maintainer. > This minor error can be easily avoided if checkpatch warns > for the same. This makes no sense to me. How about: Commit log lines starting with # are dropped by git as comments so emit a warning for these comment lines. Add a --fix option to insert a space before leading # comments > +# Check for lines starting with a # > + if ($in_commit_log && $line =~ /^#/) { > + if (WARN("COMMIT_COMMENT_SYMBOL", > + "Commit log lines starting with a '#' will be dropped by git as a comment\n" . $herecurr) && Perhaps: "Commit log lines starting with '#' are dropped by git as comments\n" . $herecurr) && > + $fix) { > + $fixed[$fixlinenr] =~ s/^#/\t#/; I suggest using a space char and not a tab to avoid excess indentation. $fixed[$fixlinenr] =~ s/^/ /; _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees