Add rule to lint man
authorng0 <ng0@n0.is>
Mon, 4 Mar 2019 14:12:43 +0000 (14:12 +0000)
committerng0 <ng0@n0.is>
Mon, 4 Mar 2019 14:12:43 +0000 (14:12 +0000)
Makefile.am
contrib/scripts/lint-man.sh [new file with mode: 0755]

index 41d366b9341f57280e2c960d9b25ffdbadb08e5e..a5e36545a2ed3c84254713aabc158eebcf2c03b0 100644 (file)
@@ -38,3 +38,7 @@ check-bashism:
 check-python:
        printf "Running flake8 and 2to3 if detected.\n"
        $(top_srcdir)/contrib/scripts/lint-python.sh
+
+check-man:
+       printf "Running lint-man.sh in doc/man.\n"
+       @cd $(top_srcdir)/doc/man ; $(top_srcdir)/../../contrib/scripts/lint-man.sh || true
diff --git a/contrib/scripts/lint-man.sh b/contrib/scripts/lint-man.sh
new file mode 100755 (executable)
index 0000000..6a9f544
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# SPDX-License-Identifier: 0BSD
+# spit out ONLY error messages using groff.
+
+echo "groff check"
+for f in `find . -name \*\.[1-9]`;
+do
+    LC_ALL=en_US.UTF-8 \
+    MANROFFSEQ='' \
+    MANWIDTH=80 \
+    groff -m mandoc -b -z -w w $f;
+done
+echo "mandoc check"
+# spit out ONLY error messages with mandoc:
+mandoc -T lint `find . -name \*\.[1-9]`
+#LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 /run/current-system/profile/bin/man --warnings -E UTF-8 -l -Tutf8 -Z <*.5> >report5.log
+#LC_ALL=en_US.UTF-8 MANROFFSEQ='' MANWIDTH=80 /run/current-system/profile/bin/man --warnings -E UTF-8 -l -Tutf8 -Z <*.1> >report1.log