The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Perl::Critic::Policy::Documentation::RequirePodSections

DESCRIPTION

This Policy requires your POD to contain certain =head1 sections. If the file doesn't contain any POD at all, then this Policy does not apply. Tools like Module::Starter make it really easy to ensure that every module has the same documentation framework, and they can save you lots of keystrokes.

DEFAULTS

Different POD sections are required, depending on whether the file is a library or script (which is determined by the presence or absence of a perl shebang line).

             Default Required POD Sections

   Perl Libraries                     Perl Scripts
   ------------------------------------------------------
   NAME                               NAME
   VERSION                            VERSION
   SYNOPSIS                           USAGE
   DESCRIPTION                        DESCRIPTION
   SUBROUNTES/METHODS                 REQUIRED ARGUMENTS
                                      OPTIONS
   DIAGNOSTICS                        DIAGNOSTICS
                                      EXIT STATUS
   CONFIGURATION                      CONFIGURATION
   DEPENDENCIES                       DEPENDENCIES
   INCOMPATIBILITIES                  INCOMPATIBILITIES
   BUGS AND LIMITATIONS               BUGS AND LIMITATIONS
   AUTHOR                             AUTHOR
   LICENSE AND COPYRIGHT              LICENSE AND COPYRIGHT

CONSTRUCTOR

This policy accepts two additional key-value pairs in the new method. The keys can be either 'script_sections' or 'lib_sections', and the value is always a string of pipe-delimited POD section names. These can be configured in the .perlcriticrc file like this:

 [Documentation::RequirePodSections]
 lib_sections = NAME | SYNOPSIS | BUGS AND LIMITATIONS | AUTHOR
 bin_sections = NAME | USAGE | OPTIONS | EXIT STATUS | AUTHOR

LIMITATIONS

Currently, this Policy does not look for the required POD sections below the =head1 level. Also, it does not require the sections to appear in any particular order.

SUBROUTINES

default_script_sections()

Returns a list of the default POD section that are required for Perl scripts. A Perl script is anything that contains a shebang line that looks like /perl/.

default_lib_sections()

Returns a list of the default POD section that are required for Perl libraries and modules.

AUTHOR

Jeffrey Ryan Thalhammer <thaljef@cpan.org>

COPYRIGHT

Copyright (c) 2006 Jeffrey Ryan Thalhammer. All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of this license can be found in the LICENSE file included with this module