From: Aditya Srivastava <yashsri421@gmail.com>
To: joe@perches.com
Cc: yashsri421@gmail.com, lukas.bulwahn@gmail.com,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v3 0/2] checkpatch: fix false positive for COMMIT_LOG_LONG_LINE and provide fix
Date: Thu, 14 Jan 2021 13:05:11 +0530 [thread overview]
Message-ID: <20210114073513.15773-1-yashsri421@gmail.com> (raw)
In-Reply-To: <84492ae9-7452-d296-49ab-4d37eed3b968@gmail.com>
Currently, checkpatch gives COMMIT_LOG_LONG_LINE warning even for URL
lines, which should be avoided.
An evaluation over v5.6..v5.8 found that out of 1703 warnings reported
by this class, 161 are due to the line containg URLs. Out of these 161,
53 are due to lines where URL is the first non-whitespace character of
the line.
Fix this false positive by suggesting to prefix the URL with "Link:".
Also provide the fix option to the user.
* Applies perfectly on next-20210108
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
Changes in v3:
- Provide fix option for the warning
- Update the warning count with v5.6..v5.8
- Update regex with /^\s*[a-z][\w\.\+\-]*:\/\/\S+/i (earlier: /^\s*\b[a-z][\w\.\+\-]*:\/\/\S+/i)
Aditya Srivastava (2):
checkpatch: fix false positive for COMMIT_LOG_LONG_LINE with URLs
checkpatch: add fix option for COMMIT_LOG_LONG_LINE with URLs
scripts/checkpatch.pl | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--
2.17.1
next prev parent reply other threads:[~2021-01-14 7:36 UTC|newest]
Thread overview: 8+ 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 17:03 ` Joe Perches
2020-12-17 19:35 ` Aditya
2020-12-18 12:11 ` [PATCH v2] " Aditya Srivastava
2020-12-24 15:19 ` Aditya
2021-01-14 7:35 ` Aditya Srivastava [this message]
2021-01-14 7:35 ` [PATCH v3 1/2] " Aditya Srivastava
2021-01-14 7:35 ` [PATCH v3 2/2] checkpatch: add fix option " 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=20210114073513.15773-1-yashsri421@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).