(Sorry, now with reply all.)
Tim van der Molen (2021-04-04 17:08 +0200):
> Klemens Nanni (2021-04-04 15:54 +0200):
> > On Sun, Apr 04, 2021 at 03:42:03PM +0200, Tim van der Molen wrote:
> > > Doesn't mandoc -Tlint -Wstyle do what you want?
> > I don't think so. Oddly enough, `-Wstyle' does not do what I would
> > expect: it omits STYLE messages instead of printing them. From mandoc
> >
> > -W level
> > Specify the minimum message level to be reported on the standard
> > error output and to affect the exit status. The level can be
> > base, style, warning, error, or unsupp. [...]
> >
> > That reads like `-Wstyle' should include STYLE.
>
> AFAIK, -Wstyle does include style messages, but it leaves out the
> OpenBSD-specific ones. For example:
>
> $ echo '.Dd April 4, 2021\n.Os' | mandoc -Tlint
> mandoc: <stdin>:1:5: STYLE: Mdocdate missing: Dd April 4, 2021 (OpenBSD)
> mandoc: <stdin>: WARNING: missing manual title, using UNTITLED: EOF
> mandoc: <stdin>: STYLE: RCS id missing: (OpenBSD)
> mandoc: <stdin>: WARNING: no document body
>
> $ echo '.Dd April 4, 2021\n.Os' | mandoc -Tlint -Wstyle
> mandoc: <stdin>: WARNING: missing manual title, using UNTITLED: EOF
> mandoc: <stdin>: WARNING: no document body
>
> > > -Wstyle also suppresses other warnings that aren't interesting for
> > > manuals not
> > > part of OpenBSD:
> > But it would also suppress legitimate messages, e.g. `.Xr' macros with
> > misspelled manuals in the base MANPATH:
>
> On the other hand, I imagine there are manuals in ports that refer to
> manuals that don't exist on OpenBSD. This would still give you the false
> positives you wanted to avoid. But of course that might be an acceptable
> tradeoff; I can't say a priori.
>
> > $ echo .Xr true 1 | mandoc -mdoc -Tlint
> > mandoc: <stdin>: WARNING: missing date, using ""
> > mandoc: <stdin>: WARNING: missing manual title, using UNTITLED: EOF
> > mandoc: <stdin>: WARNING: missing Os macro, using ""
> > mandoc: <stdin>:1:2: WARNING: content before first section header: Xr
> > $ echo .Xr tru 1 | mandoc -mdoc -Tlint
> > mandoc: <stdin>: WARNING: missing date, using ""
> > mandoc: <stdin>: WARNING: missing manual title, using UNTITLED: EOF
> > mandoc: <stdin>: WARNING: missing Os macro, using ""
> > mandoc: <stdin>:1:2: WARNING: content before first section header: Xr
> > mandoc: <stdin>:1:6: STYLE: referenced manual not found: Xr tru 1
> > $ echo .Xr tru 1 | mandoc -mdoc -Tlint -Wstyle
> > mandoc: <stdin>: WARNING: missing date, using ""
> > mandoc: <stdin>: WARNING: missing manual title, using UNTITLED: EOF
> > mandoc: <stdin>: WARNING: missing Os macro, using ""
> > mandoc: <stdin>:1:2: WARNING: content before first section header: Xr
> >
> > >
> > > $ 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
> > >