mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org, lukas.bulwahn@gmail.com,
	Peilin Ye <yepeilin.cs@gmail.com>
Subject: Re: [PATCH v3] checkpatch: add warning for lines starting with a '#' in commit log
Date: Wed, 02 Dec 2020 13:03:21 -0800	[thread overview]
Message-ID: <51225354b2a533250dad967ef413aaa4f41dfd66.camel@perches.com> (raw)
In-Reply-To: <20201202205740.127986-1-dwaipayanray1@gmail.com>

On Thu, 2020-12-03 at 02:27 +0530, Dwaipayan Ray wrote:
> 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 <joe@perches.com>
> Suggested-by: Peilin Ye <yepeilin.cs@gmail.com>
> Tested-by: Peilin Ye <yepeilin.cs@gmail.com>
> Signed-off-by: Dwaipayan Ray <dwaipayanray1@gmail.com>

Acked-by: Joe Perches <joe@perches.com>

> ---
> 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 &&



      reply	other threads:[~2020-12-02 21:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 20:57 Dwaipayan Ray
2020-12-02 21:03 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51225354b2a533250dad967ef413aaa4f41dfd66.camel@perches.com \
    --to=joe@perches.com \
    --cc=akpm@linux-foundation.org \
    --cc=dwaipayanray1@gmail.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=yepeilin.cs@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®