diff options
author | Eric Blake <eblake@redhat.com> | 2018-02-22 15:58:38 -0600 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2018-03-12 16:12:46 +0100 |
commit | 205f31a81adbd06830f2048ec00d729ebd67efa6 (patch) | |
tree | 2e184da4e70d5dcfa9345e9e3ee603f195678382 /scripts/checkpatch.pl | |
parent | 7eceff5b5a1faa394929cacfd3520caa5b3edf42 (diff) |
checkpatch: Exempt long URLs
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>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-x | scripts/checkpatch.pl | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index d1fe79bcc4..57daae05ea 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) { |