Skip to content

Commit

Permalink
Ignore very long URLs in tools/check-typo
Browse files Browse the repository at this point in the history
This is only to allow for a few specific instances, so for the time
being implemented for long-long and not very-long-line.
  • Loading branch information
dra27 committed Oct 25, 2017
1 parent a911a39 commit 49723e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 7 additions & 3 deletions tools/check-typo
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 49723e5

Please sign in to comment.