Login
Fixed POD bummers
[gknop/Perl-Critic.git] / TODO.pod
CommitLineData
daad783f
AL
1=head1
2
3 #######################################################################
4 # $URL$
5 # $Date$
6 # $Author$
7 # $Revision$
8 #######################################################################
9
10=head1 NEW FEATURES
11
12=over 4
13
14=item * Report safari sections instead of book page numbers.
15
16=back
17
18=head1 BUGS/LIMITATIONS
19
20=over 4
21
22=item * Errors in .perlcriticrc are silent
23
24=item * Modules::RequireVersionVar
25
26Doesn't enforce three-part versions
27
28=item * NamingConventions::ProhibitAmbiguousNames
29
30Don't allow compound names with forbidden words, like "last_record".
31Allow forbidden words in RHS of variable declarations
32
33=item * Subroutines::ProtectPrivateSubs
34
35Doesn't forbid C<< $pkg->_foo() >> because it can't tell the
36difference between that and C<< $self->_foo() >>
37
365e3d9d
AL
38=back
39
daad783f
AL
40=head1 OTHER PBP POLICIES THAT SEEM FEASIBLE TO IMPLEMENT
41
365e3d9d
AL
42=over 4
43
daad783f
AL
44=item * ValuesAndExpressions::ProhibitCommaSeparatedStatements (p68)
45
46=item * ValuesAndExpressions::RequireListParens (p71)
47
48=item * ValuesAndExpressions::ProhibitScalarGrep (p71)
49
50Look for grep in a scalar context and recommend any() instead
51
52=item * Variables::RequireLocalizedPunctuationVars (p81)
53
54=item * Variables::RequireNegativeIndices (p88)
55
56=item * Variables::RequireLexicalForLoopIterator (p108)
57
58=item * Variables::ProhibitTopicChangeInListFunction (p114)
59
60=item * Documentation::PodSpelling (p148)
61
62Base it on Pod::Spell or Test::Spelling. Add a "=for stopwords"
63section for words to skip, as per Pod::Spell.
64
65=item * BuiltinFunctions::ProhibitReverseSortBlock (p152)
66
67Don't allow first instance of C<$b> to be before first instance of C<$a>.
68
69=item * Subroutines::RequireArgUnpacking (p178)
70
71Ensure that the first child of a sub is PPI::Statement::Variable
72
73=item * Subroutines::ProhibitManyArgs (p182)
74
75If first L<PPI::Statement::Variable> is a list C<my>, make sure
76it's fewer than N elements. Otherwise make sure there are less
77than N L<PPI::Statement::Variable>s in a row at begin
78
79=item * InputOutput::RequireErrorChecking (p208)
80
81Forbid open, print, close in void context
82
83=item * InputOutput::RequireBriefOpen (p209)
84
85Make sure there's a close within N statements of an open, both with
86same lexical FH
87
88=item * InputOutput::ProhibitJoinedReadline (p213)
89
90=item * InputOutput::ProhibitExplicitStdin (p216)
91
92=item * InputOutput::ProhibitInteractiveTest (p218)
93
94Forbid -t operand
95
96=item * Miscellanea::ProhibitObnoxiousComments
97
98Forbid excessive hash marks e.g. "#### This is a loud comment ####".
99Make the obnoxious pattern configurable
100
101=item * RegularExpressions::RequireBracesForMultiline (p242)
102
103=item * RegularExpressions::ProhibitUnusualDelimiters (p246)
104
105=item * RegularExpressions::ProhibitEscapedMetacharacters (p247)
106
107=item * RegularExpressions::ProhibitEnumeratedClasses (p248)
108
109This will be avoided for ASCII-only code
110
111=item * RegularExpressions::ProhibitUnusedCapture (p252)
112
113Look for LHS of regexp or use of C<$1>, C<$2>, ... before next
114regexp
115
116=item * RegularExpressions::ProhibitCaptureWithoutTest (p253)
117
118C<$1>, C<$2>, ... must be inside conditional with no preceding regexp
119
120=item * RegularExpressions::ProhibitComplexRegexps (p261)
121
122If regexp is longer than N characters/lines, require it be split
123into C<qr//> pieces.
124
125=item * RegularExpressions::ProhibitSingleCharAlternation (p265)
126
127Not sure if this is easy or hard. Need to look at what PPI emits
128for regexps.
129
130=item * RegularExpressions::ProhibitFixedStringMatches (p271)
131
132Can't be C<qr/\s*\\A\s*\((?:\?:)?(?:\s*\w+\s*\|)*\s*\w+\s*\)\s*\\z/>
133or C<qr/\s*\\A\s*\w+\s*\\z/>
134
135=item * TestingAndDebugging::ProhibitProlongedStrictureOverride (p443)
136
137=back
138
139=head1 NON-PBP POLICIES WANTED
140
141=over 4
142
143=item * BuiltInFunctions::RequireConstantSprintfFormat
144
145=item * BuiltInFunctions::RequireConstantUnpackFormat
146
147L<http://home.earthlink.net/~josh.jore/new-warnings/slides/slide1.html>
148
149=item * ControlStructures::ProhibitIncludeViaDo
150
151Forbid C<do "foo.pl">. Not sure about this policy name.
152
153=item * CodingStyle::ProhibitNonASCII
154
155Definitely low severity! Only looks at code, not comments or POD
156
157=item * Miscellanea::RequireMinimumPerlVersion
158
159Every module should have something like C<use 5.6.0>
160
161=item * Miscellanea::Prohibit5006isms
162
163Keep the code 5.005 compatible Low severity
164
165=item * Variables::ProhibitUseVars
166
167Require C<our $foo> instead. This contradicts
168Miscellanea::Prohibit5006isms. Maybe verify C<use 5.6> before
169applying this policy. Low severity.
170
171=item * VariablesAndExpressions::ProhibitQuotedHashKeys
172
173Forbid quotes around hash keys, unless they are really needed. This
174is against what Damian says. Suggested by Adam Kennedy. Low
175severity.
176
177=item * Miscellanea::B::Lint
178
179Create a compatibility layer for the L<B::Lint> code analyzer. Make
180it very clear that this runs code and thus is a security hole.
181
182=item * CodingStyle::ProhibitFunctionalNew
183
184Good: C<< Foo::Bar->new >>, Bad: C<< new Foo::Bar >>
185
186=item * VariablesAndExpressions::RequireConstantVersion (low severity)
187
188VariablesAndExpressions::ProhibitComplexVersion (medium severity)
189L<http://rt.cpan.org/Ticket/Display.html?id=20439>
190
191=item * ProhibitStringSplit
192
193Since C<split("x", $whatever)> is translated to C<split(/x/, $whatever)>,
194you might as well write it that way anyway. It will help people
195remember. I don't know how many times I've seen someone perplexed
196by C<split("|", $something)> not working.
197
198However, there is at least one exception, and if you write such a
199rule, you should take this special case into account:
200
201 $ perl -le 'print map {"<$_>"} split q{ }, " Romeo and Juliet "'
202 <Romeo><and><Juliet>
203 $ perl -le 'print map {"<$_>"} split / /, " Romeo and Juliet "'
204 <><Romeo><and><Juliet>
205
206Quoting from L<http://perldoc.perl.org/functions/split.html>
207
208 As a special case, specifying a PATTERN of space (' ') will split
209 on white space just as split with no arguments does. Thus,
210 split(' ') can be used to emulate awk's default behavior, whereas
211 split(/ /) will give you as many null initial fields as there
212 are leading spaces.
213
214See also L<http://www.perlmonks.org/?node_id=287545>
215
216=back
217
218=head1 REFACTORINGS and ENHANCEMENTS
219
220=over 4
221
222=item * Move %FORMATS from `perlcritic` into Perl::Critic::Utils so that
223
224Test::P::C can use them. Use a subroutine instead of a package var.
225
226=item * Alias -verbose to -format option in Test::P::C.
227
228Give it same functionality as the -verbose option in `perlcritic`
229
230=item * Enhance P::C::critique() to accept file names, directories, or code strings (as refs) just like `perlcritic` does now.
231
232=back