From afa4ff8df598b60ab75a95ceac9bc0dafedd3b22 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 29 Apr 2008 10:02:51 +0100 Subject: [PATCH] [check] Filter programlistings for check-doc-syntax.sh We do not want to enforce the gtk-doc markup in the preformated examples, so run the files through sed to filter out before checking with the error detecting regexp. --- src/check-doc-syntax.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/check-doc-syntax.sh b/src/check-doc-syntax.sh index b70e3c6ec..1f7cd2a01 100755 --- a/src/check-doc-syntax.sh +++ b/src/check-doc-syntax.sh @@ -44,7 +44,10 @@ if test "x$SGML_DOCS" = x; then else type_regexp='\(.'$type_regexp'\)\|\('$type_regexp'.\)' fi -if grep "$type_regexp" $FILES | grep -v '#####'; then + +# We need to filter out gtk-doc markup errors for program listings. +files=`grep "$type_regexp" $FILES | grep -v '#####' | cut -d: -f1 | sort | uniq` +if test -n "$files" && sed -e '//,/<\/programlisting>/d' $files | grep "$type_regexp" | grep -v '#####'; then status=1 echo Error: some type names in the docs are not prefixed by hash sign, echo neither are the only token in the doc line followed by colon. @@ -56,7 +59,10 @@ func_regexp='\([^#]\|^\)\<\(cairo_[][<>/0-9a-z_]*\> \?[^][ <>(]\)' if test "x$SGML_DOCS" = x; then func_regexp='^[/ ][*] .*'$func_regexp fi -if grep "$func_regexp" $FILES | grep -v '#####'; then + +# We need to filter out gtk-doc markup errors for program listings. +files=`grep "$func_regexp" $FILES | grep -v '#####' | cut -d: -f1 | sort | uniq` +if test -n "$files" && sed -e '//,/<\/programlisting>/d' $files | grep "$func_regexp" | grep -v '#####'; then status=1 echo Error: some function names in the docs are not followed by parentheses. echo Fix this by searching for the following regexp in the above files: