]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Check for errors in html files
authorMark Andrews <marka@isc.org>
Fri, 2 Jul 2021 00:38:40 +0000 (10:38 +1000)
committerMark Andrews <marka@isc.org>
Fri, 2 Jul 2021 03:42:27 +0000 (13:42 +1000)
xmllint doesn't know about the HTML 5 <section> tag so filter
those out.

(cherry picked from commit ea0624b214638cb8b2ac1f1c4ac8ef3fd44bfb32)

.gitlab-ci.yml
util/copyrights
util/xmllint-html.sh [new file with mode: 0644]

index f5a3c6938e6930b816c3a7c0c88528bbe3c62d1f..e649e1e5749e4d3e77841f2bbf082d8caaf5f654 100644 (file)
@@ -453,6 +453,7 @@ misc:
     - xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
     - sh util/check-win32util-configure
     - sh util/check-categories.sh
+    - sh util/xmllint-html.sh
   needs: []
   artifacts:
     paths:
index 2423f69ad554fa7819546b11e209be0b3b06de78..432bc11ea5c8cad6c5c74c50941461ecbb492eb2 100644 (file)
 ./util/update_branches                         PERL    2005,2007,2012,2016,2018,2019,2020,2021
 ./util/update_copyrights                       PERL    1998,1999,2000,2001,2004,2005,2006,2007,2008,2009,2010,2012,2013,2014,2015,2016,2017,2018,2019,2020,2021
 ./util/xc                                      SH      2012,2013,2016,2018,2019,2020,2021
+./util/xmllint-html.sh                         SH      2021
 ./version                                      X       1998,1999,2000,2001,2003,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,2016,2017,2018,2019,2020,2021
 ./win32utils/Configure                         PERL    2013,2014,2015,2016,2017,2018,2019,2020,2021
 ./win32utils/GeoIP.diff                                X       2013,2018,2019,2020,2021
diff --git a/util/xmllint-html.sh b/util/xmllint-html.sh
new file mode 100644 (file)
index 0000000..4bd6c83
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh -f
+#
+# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, you can obtain one at https://mozilla.org/MPL/2.0/.
+#
+# See the COPYRIGHT file distributed with this work for additional
+# information regarding copyright ownership.
+
+files=`git ls-files '*.html'`
+if test -n "$files"
+then
+       xmllint --noout --nonet --html $files 2>&1 |
+       awk 'BEGIN { status = 0; }
+            # suppress HTML 5 <section> tag errors
+            /HTML parser error : Tag section invalid/ { getline; getline; next; }
+            { print; status = 1; }
+            END { exit status }'
+fi