Modified source files and compiled any and armel versions of packages
[pkg-perl] / deb-src / libperl-critic-perl / libperl-critic-perl-1.088 / lib / Perl / Critic / PolicySummary.pod.PL
1 #!perl  ## no critic (PodSpelling)
2 ##############################################################################
3 #      $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/Perl-Critic/lib/Perl/Critic/PolicySummary.pod.PL $
4 #     $Date: 2008-07-03 10:19:10 -0500 (Thu, 03 Jul 2008) $
5 #   $Author: clonezone $
6 # $Revision: 2489 $
7 ##############################################################################
8
9 # TODO: The "no critic" above is due to PodSpelling not being able to tell
10 # that there is no POD in this program.
11
12
13 use 5.006;
14 use 5.006001;
15 use strict;
16 use warnings;
17
18 use English qw< -no_match_vars >;
19 use Carp qw< confess >;
20
21 # We need both because the blib directory may or may not be in @INC at the
22 # time this is run.
23 use lib qw< blib lib >;
24
25 use Perl::Critic::Config;
26 use Perl::Critic::Exception::IO ();
27 use Perl::Critic::PolicyFactory (-test => 1);
28 use Perl::Critic::Utils qw< :characters >;
29 use Perl::Critic::Utils::POD qw< get_module_abstract_from_file >;
30
31 use Exception::Class ();  # Must be after P::C::Exception::*
32
33 our $VERSION = '1.088';
34
35
36 print "\n\nGenerating Perl::Critic::PolicySummary.\n";
37
38
39 my $configuration =
40     Perl::Critic::Config->new(
41         -profile => $EMPTY,
42         -severity => 1,
43         -theme => 'core',
44     );
45 my @policies = $configuration->policies();
46
47
48 my $policy_summary = 'lib/Perl/Critic/PolicySummary.pod';
49
50 ## no critic (RequireBriefOpen)
51 open my $pod_file, '>', $policy_summary
52     or confess "Could not open $policy_summary: $ERRNO";
53
54 print {$pod_file} <<'END_HEADER';
55 =head1 NAME
56
57 Perl::Critic::PolicySummary - Descriptions of the Policy modules included with L<Perl::Critic> itself.
58
59
60 =head1 DESCRIPTION
61
62 The following Policy modules are distributed with Perl::Critic.
63 (There are additional Policies that can be found in add-on
64 distributions.)  The Policy modules have been categorized according to
65 the table of contents in Damian Conway's book B<Perl Best Practices>.
66 Since most coding standards take the form "do this..." or "don't do
67 that...", I have adopted the convention of naming each module
68 C<RequireSomething> or C<ProhibitSomething>.  Each Policy is listed
69 here with its default severity.  If you don't agree with the default
70 severity, you can change it in your F<.perlcriticrc> file.  See the
71 documentation of each module for its specific details.
72
73
74 =head1 POLICIES
75
76 END_HEADER
77
78
79 my $format = <<'END_POLICY';
80 =head2 L<%s>
81
82 %s [Severity %d]
83
84 END_POLICY
85
86 eval {
87     foreach my $policy (@policies) {
88         my $module_abstract = $policy->get_raw_abstract();
89
90         printf
91             {$pod_file}
92             $format,
93             $policy->get_long_name(),
94             $module_abstract,
95             $policy->default_severity();
96     }
97
98     1;
99 }
100     or do {
101         # Yes, an assignment and not equality test.
102         if (my $exception = $EVAL_ERROR) {
103             if ( ref $exception ) {
104                 $exception->show_trace(1);
105             }
106
107             print {*STDERR} "$exception\n";
108         }
109         else {
110             print {*STDERR} "Failed printing abstracts for an unknown reason.\n";
111         }
112
113         exit 1;
114     };
115
116
117 print {$pod_file} <<'END_FOOTER';
118
119 =head1 VERSION
120
121 This is part of L<Perl::Critic> version 1.088.
122
123
124 =head1 AUTHOR
125
126 Jeffrey Ryan Thalhammer <thaljef@cpan.org>
127
128 =head1 COPYRIGHT
129
130 Copyright (c) 2005-2008 Jeffrey Ryan Thalhammer.  All rights reserved.
131
132 This program is free software; you can redistribute it and/or modify
133 it under the same terms as Perl itself.  The full text of this license
134 can be found in the LICENSE file included with this module.
135
136 =cut
137 END_FOOTER
138
139
140 close $pod_file or confess "Could not close $policy_summary: $ERRNO";
141
142
143 print "Done.\n\n";
144
145
146 ##############################################################################
147 # Local Variables:
148 #   mode: cperl
149 #   cperl-indent-level: 4
150 #   fill-column: 78
151 #   indent-tabs-mode: nil
152 #   c-indentation-style: bsd
153 # End:
154 # ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround :