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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 15EB4C6369E for ; Wed, 2 Dec 2020 20:58:12 +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 4696F22206 for ; Wed, 2 Dec 2020 20:58:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4696F22206 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.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 77CC9872B3; Wed, 2 Dec 2020 20:58:10 +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 VJyC_QCBJpgn; Wed, 2 Dec 2020 20:58:10 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by fraxinus.osuosl.org (Postfix) with ESMTP id F1207872A4; Wed, 2 Dec 2020 20:58:09 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id D4EEBC163C; Wed, 2 Dec 2020 20:58:09 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id 6AC06C0052 for ; Wed, 2 Dec 2020 20:58:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 47E172040F for ; Wed, 2 Dec 2020 20:58:08 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QntMwT3DDf4k for ; Wed, 2 Dec 2020 20:58:07 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by silver.osuosl.org (Postfix) with ESMTPS id 70AD82002E for ; Wed, 2 Dec 2020 20:58:07 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id w16so1850165pga.9 for ; Wed, 02 Dec 2020 12:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kZoiJysIE6nklYevoiw7YQHmFZ3mb7vgfEQBLxTf4ro=; b=LJXmnV5XM5jpdHywKUDKsGnhPXfxmIfvNsdjJvmQmhH8fjI24kw0L9S76iBLvPlJ8q OIUdkKyokkp0ZkuurpO1Q9iRM3TBjAjxbxQ/CZaNBFlInQjxoBfwN3LZn2JJIXqLG4/9 miFhaby0srQHvhoFarNyVMkZSB8DlXMlRF+pc5i4KXMuTOCAqMzJuXT9TiO28JJYHnoa r1FaOaNZnfBK3F5kH7UrJoR1H3I9MdJCS1XvtCvTjlrqJjhw/BcX7BCaM4GJj7webxOp qIcfDyT/abVa/zuMkq/V+AiHIdfB/597L+VXblE+2ryiPg97iUrj6iGgn089EQyU1l46 Samw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=kZoiJysIE6nklYevoiw7YQHmFZ3mb7vgfEQBLxTf4ro=; b=K6GdiAC6hm62ClwdwuFjPJmh26l9JmdGVlLajodk7R6WTelqNXPeNcs/l433HyhkEk Cu7lCLN9UDrPmZX217XDDfmyfm2h2JgKBk8fxuK8Ip0PecBiDEqzSu8VMkqIuHAqf/F3 SLoRMEd2lpelZVJ0Hipo+eNkjcauSxEtyZrkbx8XMTumMRfW2ZwuhPJItCZ+a6zeQqIn XxErBoRKGIWR3rcsv7VnrrQ7b66o5ThpPbYGbvKDmCGZjkS8iJjtQcDvM+jZ6HGtGCND TtJiEwh8+jUVIOkpaBVJokCcHsZaPat3lVbGzF+I5PVuQYLyfNgjOGcJo3UW7gmWDTvD pWSQ== X-Gm-Message-State: AOAM533vCaCGDqk1Z5sFyr0j2pe/bceHAWJnNbVls8DXRWE1ihScFLht Ts6ej1GsB6qZ0av0uTTGlVs= X-Google-Smtp-Source: ABdhPJw0CHfYgivBLWvIxs8tSyC5V2/y4Gh3eDFW+qKjHQWEPfbgBUxn3Mqtm+JaTbSpM2WTj3O7Kg== X-Received: by 2002:a62:d11b:0:b029:18b:b3e:95aa with SMTP id z27-20020a62d11b0000b029018b0b3e95aamr3217pfg.3.1606942686814; Wed, 02 Dec 2020 12:58:06 -0800 (PST) Received: from localhost.localdomain ([2405:201:9004:6a1b:d60e:9bc5:1ecd:a6f8]) by smtp.gmail.com with ESMTPSA id b13sm17614pfo.15.2020.12.02.12.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 12:58:05 -0800 (PST) From: Dwaipayan Ray To: joe@perches.com Date: Thu, 3 Dec 2020 02:27:40 +0530 Message-Id: <20201202205740.127986-1-dwaipayanray1@gmail.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Cc: Peilin Ye , dwaipayanray1@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, linux-kernel@vger.kernel.org Subject: [Linux-kernel-mentees] [PATCH v3] 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" Commit log lines starting with '#' are dropped by git as comments. Add a check to emit a warning for these lines. Also add a --fix option to insert a space before the leading '#' in such lines. Suggested-by: Joe Perches Suggested-by: Peilin Ye Tested-by: Peilin Ye Signed-off-by: Dwaipayan Ray --- Changes in v3: - Modify commit message for more clarity - Modify warning message - Modify --fix option to substitute single space instead of tab Changes in v2: - Modify warning message and type - Style fixes scripts/checkpatch.pl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index e8c1ed0b1fad..7940889877ba 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2966,6 +2966,15 @@ sub process { $commit_log_possible_stack_dump = 0; } +# Check for lines starting with a # + if ($in_commit_log && $line =~ /^#/) { + if (WARN("COMMIT_COMMENT_SYMBOL", + "Commit log lines starting with '#' are dropped by git as comments\n" . $herecurr) && + $fix) { + $fixed[$fixlinenr] =~ s/^/ /; + } + } + # Check for git id commit length and improperly formed commit descriptions if ($in_commit_log && !$commit_log_possible_stack_dump && $line !~ /^\s*(?:Link|Patchwork|http|https|BugLink|base-commit):/i && -- 2.27.0 _______________________________________________ Linux-kernel-mentees mailing list Linux-kernel-mentees@lists.linuxfoundation.org https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees