Ignore very long URLs in tools/check-typo

This is only to allow for a few specific instances, so for the time
being implemented for long-long and not very-long-line.
master
David Allsopp 2017-08-16 15:21:43 +01:00
parent a911a39b70
commit 49723e5fd4
2 changed files with 8 additions and 4 deletions

2
.gitattributes vendored
View File

@ -50,7 +50,7 @@ README* ocaml-typo=missing-header
asmcomp/*/emit.mlp ocaml-typo=tab,long-line,unused-prop
asmcomp/power/NOTES.md ocaml-typo=missing-header,long-line
asmcomp/power/NOTES.md ocaml-typo=missing-header
asmrun/i386.S ocaml-typo=long-line

View File

@ -222,9 +222,13 @@ IGNORE_DIRS="
}
$0 !~ /\t/ && length($0) > 80 {
RSTART = 81;
RLENGTH = 0;
err("long-line", "line is over 80 columns");
t = $0;
sub(/https?:[A-Za-z0-9._~:/?#\[\]@!$&\047()*+,;=%-]{73,}$/, "", t);
if (length(t) > 80) {
RSTART = 81;
RLENGTH = 0;
err("long-line", "line is over 80 columns");
}
}
$0 !~ /\t/ && length($0) > 132 {