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