All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aditya <yashsri421@gmail.com>
To: joe@perches.com
Cc: lukas.bulwahn@gmail.com,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] checkpatch: fix false positive for COMMIT_LOG_LONG_LINE with URLs
Date: Thu, 24 Dec 2020 20:49:55 +0530	[thread overview]
Message-ID: <84492ae9-7452-d296-49ab-4d37eed3b968@gmail.com> (raw)
In-Reply-To: <20201218121133.18614-1-yashsri421@gmail.com>

On 18/12/20 5:41 pm, Aditya Srivastava wrote:
> Currently checkpatch warns for long line in commit messages even for
> URL lines.
> 
> An evaluation over v4.13..v5.8 showed that out of 11729 warnings for
> this class, around 299 are due to line starting with URL.
> 
> E.g., running checkpatch on commit 3cde818cd02b ("ASoC: topology:
> Consolidate how dtexts and dvalues are freed") reports this warning:
> 
> WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
> https://mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
> 
> Avoid giving users warning for character limit for such cases, instead
> suggest them to prefix the URLs with "Link:"
> 
> Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
> ---
> changes in v2:
> - Fix coding style ('} else {')
> - Make the URL check follow RFC 3986 style
> - Give warning only if the URL is first non-whitespace of the line
> - Set $commit_log_long_line only for else case
> - Fix the warning count with exact figures and according to first non-space char as URL
> 
>  scripts/checkpatch.pl | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index abd5a3d2e913..bf77bd0b22cf 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3032,9 +3032,14 @@ sub process {
>  		      $line =~ /^\s*(?:Fixes:|Link:|$signature_tags)/i ||
>  					# A Fixes: or Link: line or signature tag line
>  		      $commit_log_possible_stack_dump)) {
> -			WARN("COMMIT_LOG_LONG_LINE",
> -			     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
> -			$commit_log_long_line = 1;
> +			if ($line =~ /^\s*\b[a-z][\w\.\+\-]*:\/\/\S+/i) {
> +				WARN("COMMIT_LOG_LONG_LINE",
> +				     "Consider prefixing the URL with 'Link:'\n" . $herecurr);
> +			} else {
> +				WARN("COMMIT_LOG_LONG_LINE",
> +				     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
> +				$commit_log_long_line = 1;
> +			}
>  		}
>  
>  # Reset possible stack dump if a blank line is found
> 

Hi Joe
You probably missed this patch. Please review :)

Thanks
Aditya

WARNING: multiple messages have this Message-ID (diff)
From: Aditya <yashsri421@gmail.com>
To: joe@perches.com
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [Linux-kernel-mentees] [PATCH v2] checkpatch: fix false positive for COMMIT_LOG_LONG_LINE with URLs
Date: Thu, 24 Dec 2020 20:49:55 +0530	[thread overview]
Message-ID: <84492ae9-7452-d296-49ab-4d37eed3b968@gmail.com> (raw)
In-Reply-To: <20201218121133.18614-1-yashsri421@gmail.com>

On 18/12/20 5:41 pm, Aditya Srivastava wrote:
> Currently checkpatch warns for long line in commit messages even for
> URL lines.
> 
> An evaluation over v4.13..v5.8 showed that out of 11729 warnings for
> this class, around 299 are due to line starting with URL.
> 
> E.g., running checkpatch on commit 3cde818cd02b ("ASoC: topology:
> Consolidate how dtexts and dvalues are freed") reports this warning:
> 
> WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line)
> https://mailman.alsa-project.org/pipermail/alsa-devel/2019-January/144761.html
> 
> Avoid giving users warning for character limit for such cases, instead
> suggest them to prefix the URLs with "Link:"
> 
> Signed-off-by: Aditya Srivastava <yashsri421@gmail.com>
> ---
> changes in v2:
> - Fix coding style ('} else {')
> - Make the URL check follow RFC 3986 style
> - Give warning only if the URL is first non-whitespace of the line
> - Set $commit_log_long_line only for else case
> - Fix the warning count with exact figures and according to first non-space char as URL
> 
>  scripts/checkpatch.pl | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index abd5a3d2e913..bf77bd0b22cf 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -3032,9 +3032,14 @@ sub process {
>  		      $line =~ /^\s*(?:Fixes:|Link:|$signature_tags)/i ||
>  					# A Fixes: or Link: line or signature tag line
>  		      $commit_log_possible_stack_dump)) {
> -			WARN("COMMIT_LOG_LONG_LINE",
> -			     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
> -			$commit_log_long_line = 1;
> +			if ($line =~ /^\s*\b[a-z][\w\.\+\-]*:\/\/\S+/i) {
> +				WARN("COMMIT_LOG_LONG_LINE",
> +				     "Consider prefixing the URL with 'Link:'\n" . $herecurr);
> +			} else {
> +				WARN("COMMIT_LOG_LONG_LINE",
> +				     "Possible unwrapped commit description (prefer a maximum 75 chars per line)\n" . $herecurr);
> +				$commit_log_long_line = 1;
> +			}
>  		}
>  
>  # Reset possible stack dump if a blank line is found
> 

Hi Joe
You probably missed this patch. Please review :)

Thanks
Aditya
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

  reply	other threads:[~2020-12-24 15:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 13:42 [PATCH] checkpatch: fix false positive for COMMIT_LOG_LONG_LINE with URLs Aditya Srivastava
2020-12-17 13:42 ` [Linux-kernel-mentees] " Aditya Srivastava
2020-12-17 17:03 ` Joe Perches
2020-12-17 17:03   ` [Linux-kernel-mentees] " Joe Perches
2020-12-17 19:35   ` Aditya
2020-12-17 19:35     ` [Linux-kernel-mentees] " Aditya
2020-12-18 12:11     ` [PATCH v2] " Aditya Srivastava
2020-12-18 12:11       ` [Linux-kernel-mentees] " Aditya Srivastava
2020-12-24 15:19       ` Aditya [this message]
2020-12-24 15:19         ` Aditya
2021-01-14  7:35         ` [PATCH v3 0/2] checkpatch: fix false positive for COMMIT_LOG_LONG_LINE and provide fix Aditya Srivastava
2021-01-14  7:35           ` [Linux-kernel-mentees] " Aditya Srivastava
2021-01-14  7:35           ` [PATCH v3 1/2] checkpatch: fix false positive for COMMIT_LOG_LONG_LINE with URLs Aditya Srivastava
2021-01-14  7:35             ` [Linux-kernel-mentees] " Aditya Srivastava
2021-01-14  7:35           ` [PATCH v3 2/2] checkpatch: add fix option " Aditya Srivastava
2021-01-14  7:35             ` [Linux-kernel-mentees] " Aditya Srivastava

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=84492ae9-7452-d296-49ab-4d37eed3b968@gmail.com \
    --to=yashsri421@gmail.com \
    --cc=joe@perches.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.