Perl::Critic::Policy::Documentation::ProhibitBadAproposMarkup(3pm)

Perl::Critic::Policy::Documentation::ProhibitBadAproposMarkup3pm

Don't use c<> markup in a name section

Overview

This policy is part of the "Perl::Critic::Pulp" add-on. It asks you not to write C<> markup in the NAME section of the POD because it comes out badly in the man-db "apropos" database. For example,

    =head1 NAME
    foo - like the C<bar> program     # bad

"pod2man" formats "C<>" using nroff macros which "man-db"'s "lexgrog" program doesn't expand, resulting in unattractive description lines from "apropos" like

    foo - like the *(C`bar*(C' program

Man's actual formatted output is fine, and the desired text is in there, just surrounded by "*(C" bits. On that basis this policy is low severity and under the "cosmetic" theme (see "POLICY THEMES" in Perl::Critic).

The NAME section is everything from "=head1 NAME" to the next "=head1". Other markup like "B<>", "I<>" and "F<>" is allowed because "pod2man" uses builtin "\fB" etc directives for them, which "lexgrog" recognises.

"=begin :man" and "=begin :roff" blocks are checked since "Pod::Man" processes those. Other "=begin" blocks are ignored as they won't appear in the roff output.

Disabling

If want markup in the NAME line, perhaps if printed output is more important than "apropos", then you can always disable from your .perlcriticrc in the usual way (see "CONFIGURATION" in Perl::Critic),

    [-Documentation::ProhibitBadAproposMarkup]

Or in an individual file with the usual "## no critic"

    ## no critic (ProhibitBadAproposMarkup)

though if the NAME part is after an "__END__" token then "Perl::Critic" 1.112 or higher is required (and the annotation must be before the "__END__").

Home page

<http://user42.tuxfamily.org/perl-critic-pulp/index.html>

Releases

4 releases since Debian 10 (Buster); the text changed 1 time.

  1. 10
  2. 11–13

From libperl-critic-pulp-perl 99-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.