On Thu, Aug 21, 2025 at 08:52:28PM +0200, Ingo Schwarze wrote:
> Hello Alejandro,

Hello Ingo!

> Alejandro Colomar wrote on Thu, Aug 07, 2025 at 01:04:21PM +0200:
> 
> > Do we want to diagnose blank lines in input before TH?
> > 
> >     alx@debian:~/tmp$ cat blank.man | nl -ba
> >          1  
> >          2  .TH a 2 d f
> >          3  .SH foo
> >          4  
> >          5  foo
> >     alx@debian:~/tmp$ groff -man -Tutf8 -wbreak -rCHECKSTYLE=3 blank.man 
> >     an.tmac:blank.man:4: style: blank line in input
> > 
> >     a(2)                System Calls Manual               a(2)
> > 
> >     foo
> >            foo
> > 
> >     f                            d                        a(2)
> > 
> > It seems inconsistent to not diagnose that.
> 
> FWIW:
> 
>    $ printf "\n.TH\n\n" | mandoc -Tlint
>   mandoc: <stdin>:2:2: WARNING: missing manual title, using UNTITLED: TH
>   mandoc: <stdin>:2:2: WARNING: missing manual section, using "": TH UNTITLED
>   mandoc: <stdin>:2:2: WARNING: missing date, using "": TH
> 
>    $ printf "\n.Dd\n\n" | mandoc -Tlint
>   mandoc: <stdin>:1:1: WARNING: blank line in fill mode, using .sp
>   mandoc: <stdin>:3:1: WARNING: blank line in fill mode, using .sp
>   mandoc: <stdin>:2:2: WARNING: missing date, using "": Dd
>   mandoc: <stdin>: WARNING: missing manual title, using UNTITLED: EOF
>   mandoc: <stdin>: WARNING: missing Os macro, using ""
>   mandoc: <stdin>:1:1: WARNING: content before first section header: sp
> 
> That is, mandoc(1) only warns about blank lines in mdoc(7) documents,
> not in man(7) documents.  The reason is that so far, i judged the average
> quality of man(7) documents in the wild low enough that warning about
> this minor detail felt too noisy to me.  In typical man(7) documents,
> there are bigger fish to fry.

:-)

I somehow understand you.  I've seen a lot of low-quality pages.  I've
had to improve the quality of the sources I maintain a lot, even though
they were already above average.

On the other hand, it's sad that I can't get many of mandoc(1)'s
diagnostics.  I'm really interested in several of them, as we've
discussed in the past.

Would you consider a knob for pedantic people like me that want the
quality of their sources to be on par with mdoc(7) documents, if not
higher?  Like maybe -Wpedantic or -Weverything?

> In mdoc(7), on the other hand, it doesn't matter where the blank
> line occurs - before the preamble macros, among the preamble
> macros, or in the document body.  The mandoc(1) program warns
> in any case.  Actually, a blank line *before* the body even
> causes two warnings: "blank line in fill mode" and "content before
> first section header".

Makes sense.

> 
> Yours,
>   Ingo


Have a lovely night!
Alex

P.S.:  I'm working on a reproducer for the other subthread.

-- 
<https://www.alejandro-colomar.es/>

Attachment: signature.asc
Description: PGP signature

Reply via email to