diff options
Diffstat (limited to 'contrib/scripts/lint/lint-man.sh')
-rwxr-xr-x | contrib/scripts/lint/lint-man.sh | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/contrib/scripts/lint/lint-man.sh b/contrib/scripts/lint/lint-man.sh new file mode 100755 index 000000000..8915e9ece --- /dev/null +++ b/contrib/scripts/lint/lint-man.sh | |||
@@ -0,0 +1,38 @@ | |||
1 | #!/bin/sh | ||
2 | # | ||
3 | # SPDX-License-Identifier: 0BSD | ||
4 | # spit out ONLY error messages using groff. | ||
5 | |||
6 | existence() | ||
7 | { | ||
8 | command -v "$1" >/dev/null 2>&1 | ||
9 | } | ||
10 | |||
11 | if existence groff; | ||
12 | then | ||
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 | # FIXME below, grande stupidity. | ||
22 | rm groff_lint.log | ||
23 | echo "Wrong use of B" | ||
24 | for f in `find . -name \*\.[1-9]`; | ||
25 | do | ||
26 | awk '/^\.B$/ {print FILENAME":"NR":"$0}' $f >> groff_lint.log || true | ||
27 | done | ||
28 | fi | ||
29 | |||
30 | echo "mandoc check" | ||
31 | # spit out ONLY error messages with mandoc: | ||
32 | if existence mandoc; | ||
33 | then | ||
34 | mandoc -T lint `find . -name \*\.[1-9]` | ||
35 | fi | ||
36 | |||
37 | #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 | ||
38 | #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 | ||