Login
gknop/Perl-Critic.git
10 years agoAdded -forced-filename option to the P::C::Document contstructor.
Jeffrey Ryan Thalhammer [Wed, 6 Oct 2010 18:38:11 +0000 (18:38 +0000)] 
Added -forced-filename option to the P::C::Document contstructor.
This allows you to give the Document a filename in situations where
the Document is being constructed from something that doesn't already
have a filename (like a reference to a scalar containing actual source
code).

10 years agoRT #61311: Subroutines::ProhibitUnusedPrivateSubroutines dies on
Tom Wyant [Tue, 14 Sep 2010 05:25:14 +0000 (05:25 +0000)] 
RT #61311: Subroutines::ProhibitUnusedPrivateSubroutines dies on
"&_name" call

The problem was that the return value of sprevious_sibling() was being
incorrectly tested.

About 12 lines into sub _find_sub_reference_in_document(), and again
about 18 lines in, the code 'defined $prior' occurs. The 'defined'
should be removed; that is, the code should just be '$prior'.

The erroneous code assumed that the PPI method sprevious_sibling()
returned undef if there was no previous sibling in the parse tree. In
fact, it is documented as returning a false value.

10 years agoAdd stop words to P::C::P::ControlStructures::ProhibitPostfixControls.
Tom Wyant [Sat, 11 Sep 2010 16:08:01 +0000 (16:08 +0000)] 
Add stop words to P::C::P::ControlStructures::ProhibitPostfixControls.

10 years agoMove the Changes comment on commit 3919 to the 'Bugs' section (what was
Tom Wyant [Thu, 9 Sep 2010 23:58:10 +0000 (23:58 +0000)] 
Move the Changes comment on commit 3919 to the 'Bugs' section (what was
I thinking?) and added the RT number.

10 years agoRT#61071: OptionsProcessor vs perl 5.8.3 Exporter
Tom Wyant [Thu, 9 Sep 2010 23:51:37 +0000 (23:51 +0000)] 
RT#61071: OptionsProcessor vs perl 5.8.3 Exporter

Updated inc/Perl/Critic/BuildUtilities.pm to require Exporter version
5.63, to get a version that understands export tags in positions other
than leading ones. Another solution was to move all the tags to the
leading position, but I thought it would be difficult to ensure that the
code stayed that way. I could also have gone with version 5.59 (the
first dual-lifed version), but the CPAN testers say 5.63 (the current
version) works back to perl 5.6.1.

10 years agoAdd "when" support to ControlStructures::ProhibitPostfixControls.
Elliot Shank [Sat, 4 Sep 2010 20:38:08 +0000 (20:38 +0000)] 
Add "when" support to ControlStructures::ProhibitPostfixControls.

10 years agoAdd '_' to the tr/// that counts arguments in the subroutine prototype,
Tom Wyant [Wed, 1 Sep 2010 18:42:04 +0000 (18:42 +0000)] 
Add '_' to the tr/// that counts arguments in the subroutine prototype,
since this is now valid (meaning, '$ but use $_ if no argument
specified').

10 years agoMake Subroutines::ProhibitManyArgs understand prototype grouping. That
Tom Wyant [Wed, 1 Sep 2010 15:14:24 +0000 (15:14 +0000)] 
Make Subroutines::ProhibitManyArgs understand prototype grouping. That
is, prototype (\[$@%]) specifies one argument, not three. Tests for this
added to .run file.

10 years agoReduce use of PPI overloads i
Elliot Shank [Mon, 30 Aug 2010 10:53:10 +0000 (10:53 +0000)] 
Reduce use of PPI overloads i
ControlStructures::ProhibitPostfixControls.

10 years agoBump trunk version of Perl-Critic to 1.110.
Elliot Shank [Mon, 30 Aug 2010 02:18:05 +0000 (02:18 +0000)] 
Bump trunk version of Perl-Critic to 1.110.

10 years agoUpdate Changes on trunk to match what was released in 1.109.
Elliot Shank [Mon, 30 Aug 2010 02:14:24 +0000 (02:14 +0000)] 
Update Changes on trunk to match what was released in 1.109.

10 years agoIt turns out that the original complaint in RT #3077 for
Elliot Shank [Mon, 30 Aug 2010 01:27:11 +0000 (01:27 +0000)] 
It turns out that the original complaint in RT #3077 for
RequireInterpolationOfMetachars dinging use of overload.pm really was
a general issue that the policy shouldn't complain about '${}' or
'@{}' because they're invalid syntax.

10 years agoFix detection of q<'@whatever'> in
Elliot Shank [Mon, 30 Aug 2010 01:08:33 +0000 (01:08 +0000)] 
Fix detection of q<'@whatever'> in
ValuesAndExpressions::RequireInterpolationOfMetachars found due to the
Email::Address change.

10 years agoAdded method Perl::Critic::Document->ppix_regexp_from_element(), as a
Tom Wyant [Tue, 24 Aug 2010 17:41:11 +0000 (17:41 +0000)] 
Added method Perl::Critic::Document->ppix_regexp_from_element(), as a
caching wrapper for PPIx::Regexp->new(), inspired by find() and (more
recently) _nodes_by_namespace().

Rewrote all uses of PPIx::Regexp->new_from_cache() and
PPIx::Regexp->new() (found in
RegularExpressions::ProhibitComplexRegexes) in terms of
ppix_regexp_from_element().

Got rid of PPIx::Regexp->flush_cache(), which is no longer needed, and
which I was never really happy with. With the cache on the document, it
Just Works, stays as long as it is needed, and automatically goes away
when it is no longer needed.

This means 'use PPIx::Regexp' only appears in Perl::Critic::Document.

10 years agoChange the test in t/08_document.t which tests
Tom Wyant [Tue, 24 Aug 2010 04:47:24 +0000 (04:47 +0000)] 
Change the test in t/08_document.t which tests
Perl::Critic::Document->uses_module() when there are no include
statements. The original (with an empty document) tickles what just
became RT #60671 in the PPI queue. The minimal way to avoid this
appeared to be using a document consisting of a single space.

It turns out that if you call PPI::Document->index_locations() on a
document with no tokens at all, it gets confused, and that's all RT
#60671 is about. Adam hadn't revoked my commit bit yet, so I committed
a proposed fix.

10 years agoSince PPIx::Regexp is no longer optional, some of the tests that use it
Tom Wyant [Mon, 23 Aug 2010 18:08:06 +0000 (18:08 +0000)] 
Since PPIx::Regexp is no longer optional, some of the tests that use it
no longer need separate .t files. These are moved into the .run files.
Unfortunately it looks like I forgot to add
t/20_policy_prohibit_unused_variables.t to subversion in the first
place, but that's where the tests in the .run file came from.

Added version to 'use PPIx::Regexp' in lib/Perl/Critic.pm.

10 years agoAdd failing test for
Elliot Shank [Mon, 23 Aug 2010 02:15:17 +0000 (02:15 +0000)] 
Add failing test for
ValuesAndExpressions::RequireInterpolationOfMetachars for punctuation
variables (it fails to complain about q<'@_'>) and fix a small
self-compliance issue in the Policy itself.

10 years agoAdd "subscripted" to xt/author/40_stop_words.
Elliot Shank [Mon, 23 Aug 2010 02:09:56 +0000 (02:09 +0000)] 
Add "subscripted" to xt/author/40_stop_words.

10 years agoFix missing import of PPIx::Regexp in Perl::Critic.
Elliot Shank [Mon, 23 Aug 2010 01:53:01 +0000 (01:53 +0000)] 
Fix missing import of PPIx::Regexp in Perl::Critic.

10 years agoMake xt/author/94_includes.t be more descriptive of what it's testing.
Elliot Shank [Mon, 23 Aug 2010 01:51:23 +0000 (01:51 +0000)] 
Make xt/author/94_includes.t be more descriptive of what it's testing.

10 years agoNote ValuesAndExpressions::RequireInterpolationOfMetachars fix in
Elliot Shank [Mon, 23 Aug 2010 01:27:54 +0000 (01:27 +0000)] 
Note ValuesAndExpressions::RequireInterpolationOfMetachars fix in
Changes.

10 years agoMake PPIx::Regexp, Perl::Tidy, Pod::Spell, and Text::ParseWords
Elliot Shank [Mon, 23 Aug 2010 01:25:02 +0000 (01:25 +0000)] 
Make PPIx::Regexp, Perl::Tidy, Pod::Spell, and Text::ParseWords
non-optional.

10 years agoFix ValuesAndExpressions::RequireInterpolationOfMetachars with respect
Elliot Shank [Mon, 23 Aug 2010 01:04:56 +0000 (01:04 +0000)] 
Fix ValuesAndExpressions::RequireInterpolationOfMetachars with respect
to Email::Address 1.890.  This consists of checking for the presence
of an "@" anywhere in the value and removal of a bad test: "@{}" and
"${}" are syntax errors.

10 years agoMove IPC::Open2 from the recommended to required dependencies since
Elliot Shank [Sat, 21 Aug 2010 02:58:38 +0000 (02:58 +0000)] 
Move IPC::Open2 from the recommended to required dependencies since
it's core.

10 years agoRealized I could simplify the code in commits 3886 and 3888 (both to do
Tom Wyant [Fri, 20 Aug 2010 04:33:39 +0000 (04:33 +0000)] 
Realized I could simplify the code in commits 3886 and 3888 (both to do
with having P::C::P::RegularExpressions::ProhibitUnusedCapture look
inside regular expressions) because PPIx::Regexp::Token::Interpolation
is a subclass of PPIx::Regexp::Token::Code, and so I could just look for
the latter, which may appear anywhere in the regexp.

Yes, this proves I don't know my way around my own code. Sigh.

10 years agoVariables::ProhibitUnusedVariables now looks inside regular expressions
Tom Wyant [Fri, 20 Aug 2010 02:47:25 +0000 (02:47 +0000)] 
Variables::ProhibitUnusedVariables now looks inside regular expressions
if PPIx::Regexp can be loaded.

10 years agoHave Subroutines::ProhibitUnusedPrivateSubroutines look inside regular
Tom Wyant [Wed, 18 Aug 2010 18:48:32 +0000 (18:48 +0000)] 
Have Subroutines::ProhibitUnusedPrivateSubroutines look inside regular
expressions if PPIx::Regexp is available.

10 years agoAdded the line number of the offending '=head1 NAME' to the
Tom Wyant [Wed, 18 Aug 2010 05:21:43 +0000 (05:21 +0000)] 
Added the line number of the offending '=head1 NAME' to the
P::C::P::Documentation::RequirePackageMatchesPodName violation
description, using the same dodge Elliot used for
Documentation::RequirePodLinksIncludeText. This is kind of for RT
#59176, though that ticket asked for a way to jigger the line number in
the exception.

10 years ago#59065 Suggested policy: prohibit conditional use statements
Tom Wyant [Fri, 13 Aug 2010 20:34:38 +0000 (20:34 +0000)] 
#59065 Suggested policy: prohibit conditional use statements

Modules::ProhibitContitionalUseStatements and the associated .run file
were attached to the RT ticket.  These are committed with very minor
changes:
* Added =for stopwords evals;
* Dropped trailing space in a few places.

These changes were made to satisfy authortest.

10 years agoUpdate inc/Perl/Critic/BuildUtilities.pm to require version 0.010 of
Tom Wyant [Mon, 9 Aug 2010 03:39:17 +0000 (03:39 +0000)] 
Update inc/Perl/Critic/BuildUtilities.pm to require version 0.010 of
PPIx::Regexp, since that is needed for the
P::C::P::RegularExpressions::ProhibitUnusedCapture ability to find
captures in the replacement portion of s/.../.../e.

This really should have been in commit 3888, but I forgot. Sorry.

10 years agoHave RegularExpressions::ProhibitUnusedCapture account for capture
Tom Wyant [Mon, 9 Aug 2010 00:34:55 +0000 (00:34 +0000)] 
Have RegularExpressions::ProhibitUnusedCapture account for capture
variables used in the replacement portion of s/.../.../e.

10 years ago#60179: BuiltinFunctions::ProhibitStringyEval dies on eval "#...";
Tom Wyant [Sun, 8 Aug 2010 19:42:39 +0000 (19:42 +0000)] 
#60179: BuiltinFunctions::ProhibitStringyEval dies on eval "#...";

The code assumed that a PPI::Document manufactured from the argument to
a stringy eval would have significant children. But Sullivan Beck, in
Date::Manip 5.54, found a reason to do a stringy eval on a comment. This
resulted in a fatal error in the policy.

The fix was simply to check to see if the first significant child was
actually defined, and report a violation if not. The .run file was
updated as well. If the patch is not in place, the .run file experiences
a fatal error, not a test failure. Caveat tester.

10 years agoAdded support for @-, @+, and their English equivalents. This only works
Tom Wyant [Wed, 4 Aug 2010 22:59:05 +0000 (22:59 +0000)] 
Added support for @-, @+, and their English equivalents. This only works
for literal integer subscripts, though. There appears to be no way for
static analysis to take account of $^N and its English equivalent.

10 years agoForgot to put the RT number on the ProhibitUnusedCapture fix committed
Tom Wyant [Wed, 4 Aug 2010 21:03:01 +0000 (21:03 +0000)] 
Forgot to put the RT number on the ProhibitUnusedCapture fix committed
as svn revision 3884. It's RT #60002.

10 years agoRT #60002 - RegularExpressions::ProhibitUnusedCapture does not
Tom Wyant [Wed, 4 Aug 2010 00:36:29 +0000 (00:36 +0000)] 
RT #60002 - RegularExpressions::ProhibitUnusedCapture does not
understand English equivalents of capture variables.

The variable of immediate concern is $LAST_PAREN_MATCH. This is now
recognized provide the document includes 'use English;'.

10 years agoAdd new policy InputOutput::RequireEncodingWithUTF8Layer. This complains
Tom Wyant [Sat, 31 Jul 2010 03:45:01 +0000 (03:45 +0000)] 
Add new policy InputOutput::RequireEncodingWithUTF8Layer. This complains
if it sees ':utf8' rather than ':encoding(utf8)' in open() or binmode().
It is severity 5.

The issue is that ':utf8' flags the string as UTF8 without validating
it. Invalid UTF8 can have bad effects in your code. Exhibit "A" is an
exploit reported on PerlMonks where a script running with -T read input
and sanitized it with m/^(\w+)$/, after which $1 contained shell
meta-characters. This leads to the same kind of problems that the
two-argument open() has, and that policy is severity 5.

10 years agoOn the mailing list, Andy Lester suggested having the "policy warning
Tom Wyant [Sat, 31 Jul 2010 03:09:03 +0000 (03:09 +0000)] 
On the mailing list, Andy Lester suggested having the "policy warning
against checking $@" recommend Try::Tiny. In the belief that this means
P::C::P::ErrorHandling::RequireCheckingReturnValueOfEval, I have done my
best (or worst) to implement the suggestion there.

11 years agoRT #59268: Documentation::RequirePodSections should not complain until the first...
Tom Wyant [Mon, 12 Jul 2010 23:10:51 +0000 (23:10 +0000)] 
RT #59268: Documentation::RequirePodSections should not complain until the first line of POD

Saved the first PPI::Token::Pod containing a '=head1', for use as the
pod-of-record. Reported the error relative to this pod-of-record, so
that the disabling annotation can come before the __END__, the __DATA__,
or the pod-of-record, whichever comes first.

Updated the .run file to test for disablement. Yes, it failed before
applying the patch to the policy.

And holy smokes, Sandy, he remembered to update the Changes file!

11 years agoRT 59176: "no critic" for pod after __END__
Tom Wyant [Fri, 9 Jul 2010 00:14:43 +0000 (00:14 +0000)] 
RT 59176: "no critic" for pod after __END__

The problem turned out to be that the determination of the end of the
scope of the Pod::Critic::Annotation was short-stopped because PPI
parses the __END__ as a PPI::Statement::End, and everything after that
is descended from the PPI::Statement::End. The solution was to descend
into the PPI::Statement::End (if it was the last thing found) and
continue the analysis. I suppose it's still possible to short-stop the
annotation, but I can't think of a way to do it.

t/03_annotations.t was updated to check for the ability to extend
annotations into the __END__ of the document.

Astoundingly, the Changes file was also updated.

11 years agoSpecify a minimum version of version.pm in BuildUtilities. RT #58952.
Elliot Shank [Tue, 29 Jun 2010 21:05:29 +0000 (21:05 +0000)] 
Specify a minimum version of version.pm in BuildUtilities.  RT #58952.

11 years agoNit-pick the docs in P::C::P::RegularExpressions::RequireDotMatchAnything
Tom Wyant [Mon, 28 Jun 2010 00:17:14 +0000 (00:17 +0000)] 
Nit-pick the docs in P::C::P::RegularExpressions::RequireDotMatchAnything

11 years agoHandle the absence of include statements in
Elliot Shank [Sun, 27 Jun 2010 23:30:04 +0000 (23:30 +0000)] 
Handle the absence of include statements in
P::C::Document::uses_module().

11 years agoRemove debugging code from P::C::Document.
Elliot Shank [Sun, 27 Jun 2010 23:08:48 +0000 (23:08 +0000)] 
Remove debugging code from P::C::Document.

11 years agoFix stupid bug in P::C::Document::_nodes_by_namespace().
Elliot Shank [Sun, 27 Jun 2010 23:07:22 +0000 (23:07 +0000)] 
Fix stupid bug in P::C::Document::_nodes_by_namespace().

11 years agoStupid just-prior-to-commit change to Test::P::C::Policy broke
Elliot Shank [Sun, 27 Jun 2010 22:47:42 +0000 (22:47 +0000)] 
Stupid just-prior-to-commit change to Test::P::C::Policy broke
everything.  :]

11 years agoMake Test::P::C::Policy well behaved and not export anything by
Elliot Shank [Sun, 27 Jun 2010 22:43:39 +0000 (22:43 +0000)] 
Make Test::P::C::Policy well behaved and not export anything by
default.

11 years agoCode cleanup of ProhibitMismatchedOperators after applying patch from
Elliot Shank [Sun, 27 Jun 2010 19:12:24 +0000 (19:12 +0000)] 
Code cleanup of ProhibitMismatchedOperators after applying patch from
RT #58751.

11 years agoApply the patch from RT #58751 to ProhibitMismatchedOperators
Elliot Shank [Sun, 27 Jun 2010 18:23:36 +0000 (18:23 +0000)] 
Apply the patch from RT #58751 to ProhibitMismatchedOperators
unmodified (modulo trailing whitespace).  Will need cleanup.

11 years agoCreate P::C::Document::uses_module().
Elliot Shank [Sun, 27 Jun 2010 18:14:32 +0000 (18:14 +0000)] 
Create P::C::Document::uses_module().

11 years agoForgot to add PPIx::Utilities::Node to required modules in
Elliot Shank [Sun, 27 Jun 2010 17:41:20 +0000 (17:41 +0000)] 
Forgot to add PPIx::Utilities::Node to required modules in
BuildUtilities.

11 years agoCreate namespaces() and subdocuments_for_namespace() on
Elliot Shank [Sun, 27 Jun 2010 17:22:27 +0000 (17:22 +0000)] 
Create namespaces() and subdocuments_for_namespace() on
P::C::Document.

11 years agoMake Test::Deep required so that I can use it for P::C::Document
Elliot Shank [Sun, 27 Jun 2010 16:16:18 +0000 (16:16 +0000)] 
Make Test::Deep required so that I can use it for P::C::Document
testing.

11 years agoUpdated P::C::P::ControlStructures::ProhibitMutatingListFunctions to
Tom Wyant [Fri, 25 Jun 2010 19:35:59 +0000 (19:35 +0000)] 
Updated P::C::P::ControlStructures::ProhibitMutatingListFunctions to
recognize that s///r (introduced in Perl 5.13.2) does not modify its
argument (instead, it returns the modified string). There is no test for
Perl version, because s///r fails to parse under earlier Perls.

Added a test to the .run file, to check for this.

Updated the Changes file (will wonders never cease!)

11 years agoChange xt/author/80_policysummary.t to match revision 3847, which
Tom Wyant [Fri, 25 Jun 2010 19:30:38 +0000 (19:30 +0000)] 
Change xt/author/80_policysummary.t to match revision 3847, which
changed '[ Severity #]' to '[ Default severity #]'.

11 years agoChange example in P::C Developer to say "Default severity" instead of
Elliot Shank [Wed, 23 Jun 2010 16:40:01 +0000 (16:40 +0000)] 
Change example in P::C Developer to say "Default severity" instead of
"Severity" in order to match the recent change to PolicySummary.

11 years agoChange the PolicySummary to use short names for link names.
Elliot Shank [Tue, 22 Jun 2010 22:09:05 +0000 (22:09 +0000)] 
Change the PolicySummary to use short names for link names.

11 years agoChange "[Severity #]" in the PolicySummary to "[Default severity #}".
Elliot Shank [Tue, 22 Jun 2010 21:47:05 +0000 (21:47 +0000)] 
Change "[Severity #]" in the PolicySummary to "[Default severity #}".
Also, mention "perlcritic --profile-proto".

11 years agoAdd link to Try::Tiny in RequireCheckingReturnValueOfEval.
Elliot Shank [Tue, 22 Jun 2010 21:01:40 +0000 (21:01 +0000)] 
Add link to Try::Tiny in RequireCheckingReturnValueOfEval.

11 years agoAdd release description to Changes. v1.108
Elliot Shank [Tue, 22 Jun 2010 20:20:13 +0000 (20:20 +0000)] 
Add release description to Changes.

11 years agoBump P::C version to 1.108.
Elliot Shank [Tue, 22 Jun 2010 20:14:07 +0000 (20:14 +0000)] 
Bump P::C version to 1.108.

11 years agoFix CORE_DEVELOPER.pod now that the PodSummary build is fixed.
Elliot Shank [Tue, 22 Jun 2010 19:38:35 +0000 (19:38 +0000)] 
Fix CORE_DEVELOPER.pod now that the PodSummary build is fixed.

11 years agoUpdate Changes into something readable by users for the 1.108 release.
Elliot Shank [Tue, 22 Jun 2010 19:36:47 +0000 (19:36 +0000)] 
Update Changes into something readable by users for the 1.108 release.

11 years agoChange "Repository" to "repository" in (MY)?META.yml.
Elliot Shank [Mon, 21 Jun 2010 14:10:33 +0000 (14:10 +0000)] 
Change "Repository" to "repository" in (MY)?META.yml.

11 years agoDocument Task::Weaken dependency. v1.107_001
Elliot Shank [Sun, 20 Jun 2010 23:25:17 +0000 (23:25 +0000)] 
Document Task::Weaken dependency.

11 years agoAdd dependency upon Task::Weaken (even though I think PPI requires it)
Elliot Shank [Sun, 20 Jun 2010 23:21:58 +0000 (23:21 +0000)] 
Add dependency upon Task::Weaken (even though I think PPI requires it)
to the prerequisites due to
http://www.cpantesters.org/cpan/report/07450890-b19f-3f77-b713-d32bba55d77f

11 years agoSet date for 1.107_001 release in Changes.
Elliot Shank [Sun, 20 Jun 2010 23:11:39 +0000 (23:11 +0000)] 
Set date for 1.107_001 release in Changes.

11 years agoAdd allow-unsafe to ProfilePrototype.
Elliot Shank [Sun, 20 Jun 2010 23:10:20 +0000 (23:10 +0000)] 
Add allow-unsafe to ProfilePrototype.

11 years agoSmall comment change in Subroutines::ProhibitAmpersandSigils and code
Elliot Shank [Sun, 20 Jun 2010 22:53:51 +0000 (22:53 +0000)] 
Small comment change in Subroutines::ProhibitAmpersandSigils and code
reformat.

11 years agoRename the --unsafe option to --allow-unsafe.
Elliot Shank [Sun, 20 Jun 2010 22:35:42 +0000 (22:35 +0000)] 
Rename the --unsafe option to --allow-unsafe.

11 years agoMove Email::Address from the optional to the required modules in the
Elliot Shank [Sun, 20 Jun 2010 22:12:13 +0000 (22:12 +0000)] 
Move Email::Address from the optional to the required modules in the
P::C POD.

11 years agoTheoretically fix the issue with compling P::C::Module::Build at
Elliot Shank [Sun, 20 Jun 2010 21:53:38 +0000 (21:53 +0000)] 
Theoretically fix the issue with compling P::C::Module::Build at
configure time due to PolicySummaryGenerator dependencies.

11 years agoGet rid of use_ok() everywhere except t/00_modules.t and
Elliot Shank [Sun, 20 Jun 2010 21:30:21 +0000 (21:30 +0000)] 
Get rid of use_ok() everywhere except t/00_modules.t and
xt/author/82_optional_modules.t.

11 years agoUpdate to TODO.pod about dumping IO::String.
Elliot Shank [Sun, 20 Jun 2010 21:12:17 +0000 (21:12 +0000)] 
Update to TODO.pod about dumping IO::String.

11 years agoFix false statement in POD about ## no critic paying attention to
Elliot Shank [Sun, 13 Jun 2010 23:34:12 +0000 (23:34 +0000)] 
Fix false statement in POD about ## no critic paying attention to
blocks.

11 years agoFix links to deprecated modules in Modules::ProhibitEvilModules.
Elliot Shank [Sun, 13 Jun 2010 23:29:31 +0000 (23:29 +0000)] 
Fix links to deprecated modules in Modules::ProhibitEvilModules.

11 years agoBump P::C version to 1.107_001.
Elliot Shank [Sun, 13 Jun 2010 23:26:31 +0000 (23:26 +0000)] 
Bump P::C version to 1.107_001.

11 years agoRemove scary warning from INSTALL.
Elliot Shank [Sun, 13 Jun 2010 23:22:36 +0000 (23:22 +0000)] 
Remove scary warning from INSTALL.

11 years agoUpdate the optional module discussion in CORE_DEVELOPER to match the
Elliot Shank [Sun, 13 Jun 2010 23:06:22 +0000 (23:06 +0000)] 
Update the optional module discussion in CORE_DEVELOPER to match the
list of modules that are not part of the standard optional ones.

11 years agoStop all conditional module usage under xt/. If you're an author,
Elliot Shank [Sun, 13 Jun 2010 23:03:03 +0000 (23:03 +0000)] 
Stop all conditional module usage under xt/.  If you're an author,
you've got to run everything.

11 years agoChange Modules::ProhibitEvilModules to complain about modules
Elliot Shank [Sun, 13 Jun 2010 19:20:19 +0000 (19:20 +0000)] 
Change Modules::ProhibitEvilModules to complain about modules
deprecated by p5p.

11 years ago(Try to) make P::C::P::Subroutines::RequireFinalReturn understand a
Tom Wyant [Mon, 31 May 2010 04:34:52 +0000 (04:34 +0000)] 
(Try to) make P::C::P::Subroutines::RequireFinalReturn understand a
final given/when statement. The intent is that this is acceptable if and
only if there is a default block and all branches have a final
unconditional return.

Some simple cases have been added to the .run file, and (glory be!) the
Changes file was updated.

11 years agoRT #57818 - DEVELOPER.pod typo in link to ValuesAndExpressions::ProhibitConstantPragm...
Tom Wyant [Tue, 25 May 2010 21:12:50 +0000 (21:12 +0000)] 
RT #57818 - DEVELOPER.pod typo in link to ValuesAndExpressions::ProhibitConstantPragma policy

11 years agoSmall typo in RequireFinalReturn POD. RT #57803
Elliot Shank [Tue, 25 May 2010 01:42:57 +0000 (01:42 +0000)] 
Small typo in RequireFinalReturn POD.  RT #57803

11 years agoTell policy BuiltInFunctions::ProhibitLvalueSubstr not to complain when
Tom Wyant [Sat, 22 May 2010 22:48:12 +0000 (22:48 +0000)] 
Tell policy BuiltInFunctions::ProhibitLvalueSubstr not to complain when
there is a low-precedence operator between the substr() and the
assignment operator.

Note that the modified code assumes that anything with the same
precedence as '=' is an assignment operator. The hash that drives the
precedence_of() subroutine contains a bunch of things at the same
precedence as '='. All appear to be things like '||=', which PPI
decomposes into '||' and '=' anyway. But if someone's religion wants a
test for a literal '=', I will be glad to oblige.

11 years agoHave policy TestingAndDebugging::RequireUseStrict accept 'use 5.011' or
Tom Wyant [Sat, 22 May 2010 18:56:41 +0000 (18:56 +0000)] 
Have policy TestingAndDebugging::RequireUseStrict accept 'use 5.011' or
greater as equivalent to 'use strict'.

11 years agoExpand list of modules needed for authortest, by actually trying to run
Tom Wyant [Fri, 21 May 2010 21:03:34 +0000 (21:03 +0000)] 
Expand list of modules needed for authortest, by actually trying to run
the authortest suite on a virgin Perl.

11 years agoUpdated lib/Perl/Critic/CORE_DEVELOPER.pod to try to document the
Tom Wyant [Thu, 20 May 2010 03:23:42 +0000 (03:23 +0000)] 
Updated lib/Perl/Critic/CORE_DEVELOPER.pod to try to document the
modules needed over and above the Perl::Critic requirements to get
authortest to run.

11 years agoBug #57375 for Perl-Critic: [PATCH] Fix spelling error in the documentation
Tom Wyant [Tue, 11 May 2010 15:51:39 +0000 (15:51 +0000)] 
Bug #57375 for Perl-Critic: [PATCH] Fix spelling error in the documentation

Accepted attached patch.

11 years agoPut 1.106 changes to Changes on trunk.
Elliot Shank [Tue, 11 May 2010 03:47:19 +0000 (03:47 +0000)] 
Put 1.106 changes to Changes on trunk.

11 years ago49501 From Debian: RequirePackageMatchesPodName: doesn't use nearest package
Tom Wyant [Fri, 7 May 2010 18:41:54 +0000 (18:41 +0000)] 
49501  From Debian: RequirePackageMatchesPodName: doesn't use nearest package

Allow any package (rather than nearest) to match the pod NAME. "Nearest"
was not used because of the practice of putting all pod at the end. The
policy still only checks the first NAME section, if more than one
exists, but since I know of no examples of this, I figure it can wait.

11 years agoUpdate P::C::Utils::is_unchecked_call() to include chmod in the set of
Elliot Shank [Tue, 27 Apr 2010 12:14:22 +0000 (12:14 +0000)] 
Update P::C::Utils::is_unchecked_call() to include chmod in the set of
builtins covered by autodie.

11 years agoChanged violation description to "Quotes used with a string containing
Elliot Shank [Thu, 22 Apr 2010 01:50:14 +0000 (01:50 +0000)] 
Changed violation description to "Quotes used with a string containing
no non-whitespace characters" in
ValuesAndExpressions::ProhibitEmptyQuotes to address RT #56623.

11 years agoWordsmith my recent Changes updates.
Tom Wyant [Wed, 21 Apr 2010 19:19:29 +0000 (19:19 +0000)] 
Wordsmith my recent Changes updates.

11 years agoRT #56619 redux
Tom Wyant [Wed, 21 Apr 2010 19:11:17 +0000 (19:11 +0000)] 
RT #56619 redux

After discussion on the mailing list, added option
allow_in_main_unless_in_subroutine to
P::C::P::ErrorHandling::RequireCarping to control whether 'warn' or
'die' are allowed unconditionally in main:: (unless in a subroutine).
This option is false by default.

The configuration documentation was updated not only to cover this, but
to try to make explicit its interaction with
allow_messages_ending_in_newlines (it's ||, not &&).

The original work was committed as revision 3799.

11 years agoRT #56667: No "$VERSION" variable found (false positive)
Tom Wyant [Tue, 20 Apr 2010 18:03:24 +0000 (18:03 +0000)] 
RT #56667: No "$VERSION" variable found (false positive)

Wordsmithed $DESC and POD in P::C::P::Modules::RequireVersionVar to
try to make explicit the fact that a lexical $VERSION is not
acceptable either to Perl's version system or to this policy. Better
wordsmithing welcome.

11 years agoRT #56619: "die" used instead of "croak" (possibly false positive)
Tom Wyant [Mon, 19 Apr 2010 18:38:58 +0000 (18:38 +0000)] 
RT #56619: "die" used instead of "croak" (possibly false positive)

Allow 'warn' or 'die' in name space main::, provided it is not in a
subroutine. This implementation per the BUGS section of the
P::C::P::ErrorHandling::RequireCarping POD (except, of course that it no
longer says that).

Some tests added to RequireCarping.run to exercise the new code, and
(glory be!) Changes updated to say in general what was done.

11 years agoRT #56627: Too many arguments (sub prototype, false positive)
Tom Wyant [Fri, 16 Apr 2010 05:48:57 +0000 (05:48 +0000)] 
RT #56627: Too many arguments (sub prototype, false positive)

If the subroutine had a prototype, the previous code computed the number
of arguments as the number of characters in the prototype, less two for
the parens. The submitted case had embedded whitespace, which is not
usual, but other characters (semicolons, backslashes, square brackets)
also trigger the problem. The fix was to use tr/// to count the
characters that actually represent arguments.

11 years ago'warnings' pragma was declared as dependency twice.
Jeffrey Ryan Thalhammer [Tue, 23 Mar 2010 03:08:09 +0000 (03:08 +0000)] 
'warnings' pragma was declared as dependency twice.

11 years agoDon't generate test file for 20_policy_require_interpolation_of_metachars.t. v1.105_03
Jeffrey Ryan Thalhammer [Mon, 22 Mar 2010 02:21:49 +0000 (02:21 +0000)] 
Don't generate test file for 20_policy_require_interpolation_of_metachars.t.

11 years agoBumped version number to 1.105_03.
Jeffrey Ryan Thalhammer [Mon, 22 Mar 2010 01:17:38 +0000 (01:17 +0000)] 
Bumped version number to 1.105_03.