Hi Bjarni,

On 8/2/22 02:13, Bjarni Ingi Gislason wrote:

   It is simpler to use a filter, like

#!/bin/dash

mandoc -T lint $* | sed -e '/cannot parse date, using it verbatim:/d' \
-e '/empty block: UR$/d' \
-e '/: \.so is fragile, better use ln/,+3 d' \
-e '/: ignoring macro in table: /d' \
-e '/: invalid escape sequence: /d' \
-e '/: lower case character in document title: /d' \
-e '/: unsupported roff request: /d' \
-e '/: missing date, using today/d' \
-e '/: line scope broken: BR breaks SM/d' | \
   sort -t: -k3n,3n

Yes, filtering out the unwanted text is trivial.

The thing is that I'm running mandoc(1) from a Makefile, which means that not only stdout/stderr is important, but also the exit status. There's no trivial way to ignore mandoc(1)'s error code for certain warnings. Also, I run it for a few thousands of manual pages, so I don't want make(1) to stop at every page that triggers an unwanted warning. But I do want make(1) to stop at errors/warnings in general.

<https://git.kernel.org/pub/scm/docs/man-pages/man-pages.git/tree/lib/lint-man.mk#n54>

I can still run something like what I ran yesterday to have an overview of the warnings:

$ make -i lint-man-mandoc \
  | grep -v UNSUPP.*ignoring.macro.in.table

But that's not ideal, because I want make(1) to stop at errors.


Cheers,

Alex

--
Alejandro Colomar
<http://www.alejandro-colomar.es/>

Attachment: OpenPGP_signature
Description: OpenPGP digital signature

Reply via email to