* [Qemu-trivial] [PATCH] checkpatch: Exempt long URLs
@ 2018-02-22 21:58 Eric Blake
2018-02-22 22:02 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Eric Blake @ 2018-02-22 21:58 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, qemu-trivial
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) {
--
2.14.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PATCH] checkpatch: Exempt long URLs
2018-02-22 21:58 [Qemu-trivial] [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
2 siblings, 0 replies; 4+ messages in thread
From: Eric Blake @ 2018-02-22 22:02 UTC (permalink / raw)
To: qemu-devel; +Cc: qemu-trivial, peter.maydell
On 02/22/2018 03:58 PM, 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
s/shorterners/shorteners/
(Is it bad when I spell-check my own patches?)
> 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>
> ---
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PATCH] checkpatch: Exempt long URLs
2018-02-22 21:58 [Qemu-trivial] [PATCH] checkpatch: Exempt long URLs Eric Blake
2018-02-22 22:02 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
@ 2018-03-06 11:41 ` Stefan Hajnoczi
2018-03-07 14:48 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Hajnoczi @ 2018-03-06 11:41 UTC (permalink / raw)
To: Eric Blake; +Cc: qemu-devel, qemu-trivial, peter.maydell
[-- Attachment #1: Type: text/plain, Size: 769 bytes --]
On Thu, Feb 22, 2018 at 03:58:38PM -0600, 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(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 455 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-trivial] [Qemu-devel] [PATCH] checkpatch: Exempt long URLs
2018-02-22 21:58 [Qemu-trivial] [PATCH] checkpatch: Exempt long URLs Eric Blake
2018-02-22 22:02 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2018-03-06 11:41 ` Stefan Hajnoczi
@ 2018-03-07 14:48 ` Paolo Bonzini
2 siblings, 0 replies; 4+ messages in thread
From: Paolo Bonzini @ 2018-03-07 14:48 UTC (permalink / raw)
To: Eric Blake, qemu-devel; +Cc: qemu-trivial, peter.maydell
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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-03-07 14:48 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22 21:58 [Qemu-trivial] [PATCH] checkpatch: Exempt long URLs Eric Blake
2018-02-22 22:02 ` [Qemu-trivial] [Qemu-devel] " Eric Blake
2018-03-06 11:41 ` Stefan Hajnoczi
2018-03-07 14:48 ` Paolo Bonzini
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).