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.
> 
> -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:

$ 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
> 

Reply via email to