From: Paolo Bonzini <pbonzini@redhat.com>
To: Eric Blake <eblake@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH] checkpatch: Exempt long URLs
Date: Wed, 7 Mar 2018 15:48:06 +0100 [thread overview]
Message-ID: <441a9060-6216-088b-82b6-71f0ad88ceb9@redhat.com> (raw)
In-Reply-To: <20180222215838.18223-1-eblake@redhat.com>
On 22/02/2018 22:58, Eric Blake wrote:
> Sometimes, we want to refer to really long URLs, but checkpatch
> balks, and we have to manually bypass the check. URL shorterners
> may be nice at reducing long links, but it's hard to guarantee the
> shortened link will live as long as the real target, and it is
> also nice to see the original target without having to load the
> shortened URL through a browser. So exempt a line containing
> only a URL from the long-line syntax check.
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
> scripts/checkpatch.pl | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 1b4b812e28f..0d3f753c665 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1447,9 +1447,10 @@ sub process {
> # check we are in a valid source file if not then ignore this hunk
> next if ($realfile !~ /$SrcFile/);
>
> -#90 column limit
> +#90 column limit; exempt URLs, if no other words on line
> if ($line =~ /^\+/ &&
> !($line =~ /^\+\s*"[^"]*"\s*(?:\s*|,|\)\s*;)\s*$/) &&
> + !($rawline =~ /^[^[:alnum:]]*https?:\S*$/) &&
> $length > 80)
> {
> if ($length > 90) {
>
Queued, thanks.
Paolo
prev parent reply other threads:[~2018-03-07 14:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-22 21:58 [Qemu-devel] [PATCH] checkpatch: Exempt long URLs Eric Blake
2018-02-22 22:02 ` Eric Blake
2018-03-06 11:41 ` Stefan Hajnoczi
2018-03-07 14:48 ` Paolo Bonzini [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=441a9060-6216-088b-82b6-71f0ad88ceb9@redhat.com \
--to=pbonzini@redhat.com \
--cc=eblake@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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).