[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #62776] [troff] want "style" warning category for self-deceptive in

From: Alejandro Colomar
Subject: [bug #62776] [troff] want "style" warning category for self-deceptive inputs
Date: Wed, 26 Apr 2023 09:17:07 -0400 (EDT)

Follow-up Comment #10, bug #62776 (project groff):

[comment #9 comment #9:]
> comment #8 comment #8:]
> > Disabling a warning if you don't care is easy.
> I would love for that to be true of groff warnings.  Unfortunately, you can
only enable and disable warnings by category, the existing categories range in
scope from ridiculously narrow to overly broad, and there's not a scalable
mechanism for adding more.  Realistically this proposed warning will end up in
the same category as others you might care about even if you intentionally use
' when not strictly necessary.

It's actually true of warnings in any software (especially in software that
produces a single line for each diagnostic).  As I said recently in the
mailing list, here's what I do with mandoc(1), which doesn't have any native
mechanisms for disabling warnings:

$(_LINT_man_mandoc): $(_MANDIR)/%.lint-man.mandoc.touch: $(MANDIR)/% |
        $(info LINT (mandoc)    $@)
        ! ($(MANDOC) -man $(MANDOCFLAGS) $< 2>&1 \
           | $(GREP) -v 'STYLE: lower case character in document title:' \
           | $(GREP) -v 'UNSUPP: ignoring macro in table:' \
           | $(GREP) -v 'WARNING: cannot parse date, using it verbatim: TH 
(date)' \
           | $(GREP) -v 'WARNING: empty block: UR' \
           | $(GREP) -v 'WARNING: missing date, using "": TH' \
           | $(GREP) -v 'WARNING: undefined escape, printing literally: \\\\' \
           ||:; \
        ) \
        | $(GREP) '.' >&2
        touch $@

$(_LINT_mdoc_mandoc): $(_MANDIR)/%.lint-mdoc.mandoc.touch: $(MANDIR)/% |
        $(info LINT (mandoc)    $@)
        ! ($(MANDOC) -mdoc $(MANDOCFLAGS) $< 2>&1 \
           | $(GREP) -v 'STYLE: operating system explicitly specified: Os ' \
           | $(GREP) -v 'WARNING: cross reference to self: Xr ' \
           ||:; \
        ) \
        | $(GREP) '.' >&2
        touch $@

grep(1) is your tool for disabling unwanted diagnostics.  ;)


Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]