diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rwxr-xr-x | contrib/scripts/lint-man.sh | 31 |
2 files changed, 24 insertions, 9 deletions
diff --git a/Makefile.am b/Makefile.am index daa2946a7..3c1d8c8fc 100644 --- a/Makefile.am +++ b/Makefile.am | |||
@@ -42,3 +42,5 @@ check-python: | |||
42 | check-man: | 42 | check-man: |
43 | printf "Running lint-man.sh in doc/man.\n" | 43 | printf "Running lint-man.sh in doc/man.\n" |
44 | @cd $(top_srcdir)/doc/man ; $(top_srcdir)/../../contrib/scripts/lint-man.sh || true | 44 | @cd $(top_srcdir)/doc/man ; $(top_srcdir)/../../contrib/scripts/lint-man.sh || true |
45 | |||
46 | check-linters: check-bashism check-python check-man | ||
diff --git a/contrib/scripts/lint-man.sh b/contrib/scripts/lint-man.sh index 6a9f544f4..1a3f1514a 100755 --- a/contrib/scripts/lint-man.sh +++ b/contrib/scripts/lint-man.sh | |||
@@ -3,16 +3,29 @@ | |||
3 | # SPDX-License-Identifier: 0BSD | 3 | # SPDX-License-Identifier: 0BSD |
4 | # spit out ONLY error messages using groff. | 4 | # spit out ONLY error messages using groff. |
5 | 5 | ||
6 | echo "groff check" | 6 | existence() |
7 | for f in `find . -name \*\.[1-9]`; | 7 | { |
8 | do | 8 | command -v "$1" >/dev/null 2>&1 |
9 | LC_ALL=en_US.UTF-8 \ | 9 | } |
10 | MANROFFSEQ='' \ | 10 | |
11 | MANWIDTH=80 \ | 11 | if existence groff; |
12 | groff -m mandoc -b -z -w w $f; | 12 | then |
13 | done | 13 | echo "groff check" |
14 | for f in `find . -name \*\.[1-9]`; | ||
15 | do | ||
16 | LC_ALL=en_US.UTF-8 \ | ||
17 | MANROFFSEQ='' \ | ||
18 | MANWIDTH=80 \ | ||
19 | groff -m mandoc -b -z -w w $f; | ||
20 | done | ||
21 | fi | ||
22 | |||
14 | echo "mandoc check" | 23 | echo "mandoc check" |
15 | # spit out ONLY error messages with mandoc: | 24 | # spit out ONLY error messages with mandoc: |
16 | mandoc -T lint `find . -name \*\.[1-9]` | 25 | if existence mandoc; |
26 | then | ||
27 | mandoc -T lint `find . -name \*\.[1-9]` | ||
28 | fi | ||
29 | |||
17 | #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 | 30 | #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 |
18 | #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 | 31 | #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 |