allow long lines up to 132 chars in ocamldoc

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15018 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Damien Doligez 2014-07-21 20:41:52 +00:00
parent 9ac64ba6a4
commit 6ba26a91f2
1 changed files with 16 additions and 5 deletions

View File

@ -23,6 +23,7 @@
# - absence of empty lines at end of file (white-at-eof)
# - presence of a LF character at the end of the file (missing-lf)
# - maximum line length of 80 characters (long-line)
# - maximum line length of 132 characters (very-long-line)
# - presence of a copyright header (missing-header)
# - absence of a leftover "$Id" string (svn-keyword)
@ -49,6 +50,9 @@
# *.mltop
# *.odocl
# *.clib
# - Any file whose name matches the following pattern is automatically
# exempt from the "long-line" rule (but not from "very-long-line").
# */ocamldoc/*
# ASCII characters are bytes from 0 to 127. Any other byte is
# flagged as a non-ASCII character.
@ -130,15 +134,16 @@ IGNORE_DIRS="
svnrules=`svn propget ocaml:typo "$f"`
fi
rules="$userrules"
add_hd(){ rules="missing-header,$rules"; }
case "$f" in
Makefile*|*/Makefile*) rules="tab,$rules";;
esac
h(){ rules="missing-header,$rules"; }
case "$f" in
*/.depend*|*/.ignore) h;;
*.mlpack|*.mllib|*.mltop|*.odocl|*.itarget|*.clib) h;;
*/.depend*|*/.ignore) add_hd;;
*.mlpack|*.mllib|*.mltop|*.odocl|*.itarget|*.clib) add_hd;;
*.reference|*/reference) continue;;
esac
case "$f" in
ocamldoc/*|*/ocamldoc/*) rules="long-line,$rules";;
esac
(cat "$f"; echo) \
| awk -v rules="$rules" -v svnrules="$svnrules" -v file="$f" \
@ -182,6 +187,12 @@ IGNORE_DIRS="
err("long-line", "line is over 80 characters");
}
length($0) > 132 {
RSTART = 133;
RLENGTH = 0;
err("very-long-line", "line is over 132 characters");
}
3 <= NR && NR <= 5 \
&& (/ OCaml / || / ocamlbuild / || / OCamldoc /) {
header_ocaml = NR;