checkpatch: Exempt long URLs
PATCH 1/1 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 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.
--- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
scripts/checkpatch.pl +2 -1
@@ -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) {
Signature · 1 line
2.14.3
Quoted 2 lines · Eric Blake
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?)
Quoted 9 lines
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 <[email protected]>Signed-off-by Eric Blake <[email protected]>---
Signature · 3 lines
Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
Quoted 8 lines · Eric Blake
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.
Quoted 5 lines
Suggested-by Peter Maydell <[email protected]>Signed-off-by Eric Blake <[email protected]>--- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Paolo Bonzini
AppliedQuoted 21 lines · Eric Blake
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 <[email protected]>Signed-off-by Eric Blake <[email protected]>--- scripts/checkpatch.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)scripts/checkpatch.pl +0
-0@@ -1447,9 +1447,10 @@ sub process { # check we are in a valid source file if not then ignore this hunk
scripts/checkpatch.pl sub process { · line 1456
Quoted 10 lines
scripts/checkpatch.pl +2
-1next 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