]> git.proxmox.com Git - mirror_qemu.git/commitdiff
checkpatch: Exempt long URLs
authorEric Blake <eblake@redhat.com>
Thu, 22 Feb 2018 21:58:38 +0000 (15:58 -0600)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 12 Mar 2018 15:12:46 +0000 (16:12 +0100)
Sometimes, we want to refer to really long URLs, but checkpatch
balks, and we have to manually bypass the check.  URL shorteners
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.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180222215838.18223-1-eblake@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
scripts/checkpatch.pl

index d1fe79bcc47cc1a02863f94be140a634fde48184..57daae05ea181ca3aac849e434255e89d2f7445e 100755 (executable)
@@ -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) {