Klemens Nanni (2021-04-03 02:33 +0200):
> It has always bothered me that linting manuals complained about missing
> manuals from packages despite their path being part of the default
> MANPATH:
> 
> No local man(1) config:
> 
>       $ echo $MANPATH
>       ksh: MANPATH: parameter not set
>       $ cat /etc/man.conf
>       cat: /etc/man.conf: No such file or directory
> 
> man(1) finds tog(1), but mandoc(1) does not:
> 
>       $ mandoc -T lint `man -w tog` | grep 'not found'
>       mandoc: /usr/local/man/man1/tog.1:35:6: STYLE: referenced manual not 
> found: Xr git-repository 5 (2 times)
>       mandoc: /usr/local/man/man1/tog.1:188:6: STYLE: referenced manual not 
> found: Xr got 1 (6 times)
> 
> Not having those STYLE "issues" also makes `mandoc -T lint' more useful
> for automatic regression/pre-commit/etc. checks in ports using it since
> even STYLE messages result in a non-zero exit status, i.e. `make test'
> for a totally fine manual would fail.
> 
> Using `-W warning' to omit STYLE message entirely is undesired because
> it silences other useful style hints as well and parsing output to work
> around all this is hackish at best.
> 
> So let's lint manuals with the default MANPATH instead of the limited
> base one.
> 
> Feedback? Objections? OK?

Doesn't mandoc -Tlint -Wstyle do what you want?

-Wstyle also suppresses other warnings that aren't interesting for manuals not
part of OpenBSD:

$ mandoc -Tlint /usr/local/man/man1/stagit.1
mandoc: /usr/local/man/man1/stagit.1:1:5: STYLE: Mdocdate missing: Dd March 5, 
2021 (OpenBSD)
mandoc: /usr/local/man/man1/stagit.1: STYLE: RCS id missing: (OpenBSD)
mandoc: /usr/local/man/man1/stagit.1:113:6: STYLE: referenced manual not found: 
Xr stagit-index 1
$ mandoc -Tlint -Wstyle /usr/local/man/man1/stagit.1
$ echo $?
0

Reply via email to