Login
gknop/Perl-Critic.git
10 years agoNo longer generating the PolicySummary when running the "test" action.
Jeffrey Ryan Thalhammer [Sun, 24 Jan 2010 04:56:40 +0000 (04:56 +0000)] 
No longer generating the PolicySummary when running the "test" action.
This was causing all the build failures in the last release, because
the PolicySummary had already been generated and had read-only
permissions when a user receives the distro.  So running "./Build test"
would fail because it would try to regenerate the read-only file.

I also noticed that we're deleting and regenerating the MANIFEST
every time that you "./Build test".  This seems like a convenience
for us authors, but for end-users, it seems like awfully weird behavior.
So I took that out as well.

So now, the PolicySummary and MANIFEST are generated only when running
authortest, which always happens before making a distro.  If an author
wants to run some other tests that require the MANIFEST, then it is up
to them to run the "manifest" target.

At least, this is what makes sense to me.  I know Elliot has strong
opionions about this, and went to great lengths to configure this
build arrangement.  So he may think differently.

10 years agoWoops, found one more reference to that missing page on cyclomaic complexity
Jeffrey Ryan Thalhammer [Sun, 24 Jan 2010 04:16:25 +0000 (04:16 +0000)] 
Woops, found one more reference to that missing page on cyclomaic complexity

10 years agoFixed RT #53219 (perldoc has broken link for McCabe score definition)
Jeffrey Ryan Thalhammer [Sun, 24 Jan 2010 04:14:43 +0000 (04:14 +0000)] 
Fixed RT #53219 (perldoc has broken link for McCabe score definition)

10 years agoRe-jiggered 20_policy_require_interpolation_of_metachars.t
Jeffrey Ryan Thalhammer [Sun, 24 Jan 2010 04:10:02 +0000 (04:10 +0000)] 
Re-jiggered 20_policy_require_interpolation_of_metachars.t
so that the tests are run both with AND without Email::Address,
rather than skipping if the module isn't present.

10 years agoRT 43291: t/20_policy_pod_spelling - wrong number of tests for Non English - patch...
Tom Wyant [Sun, 24 Jan 2010 03:55:19 +0000 (03:55 +0000)] 
RT 43291: t/20_policy_pod_spelling - wrong number of tests for Non English - patch included
RT 48986: t/20_policy_pod_spelling.t test failure in non-English locale

Both tickets referred to the same problem -- the wrong number of tests
being skipped in a non-English locale. Both included similar patches,
which created a variable to hold the number of tests, and then used this
in both 'plan ( tests => ... )' and 'skip ...'. The committed code is
similar to the patches, but defines the variable as Readonly::Scalar.

The committed code also includes a fairly ugly change to cover the case
when aspell dies for whatever reason (e.g. not finding a dictionary for
the current locale.) It was tested under Fedora 12 while logged in as
Español de España. Some Documentation::PodSpelling failures were
uncovered once I got aspell working right in English; those were not
fixed in this commit.

10 years agoVanquishing Regexp::Parser, thanks to Tom! Woot!
Jeffrey Ryan Thalhammer [Sun, 24 Jan 2010 03:39:42 +0000 (03:39 +0000)] 
Vanquishing Regexp::Parser, thanks to Tom!  Woot!

10 years agoRegularExpressions::ProhibitCaptureWithoutTest now handles when() in the
Tom Wyant [Fri, 22 Jan 2010 05:10:25 +0000 (05:10 +0000)] 
RegularExpressions::ProhibitCaptureWithoutTest now handles when() in the
same manner as if(), etc. As of right now, this is the only remaining
issue on RT #36081.

10 years agoRT 43309: Subroutines::RequireFinalReturn with given() block
Tom Wyant [Wed, 20 Jan 2010 04:28:27 +0000 (04:28 +0000)] 
RT 43309: Subroutines::RequireFinalReturn with given() block

This appears to have come right when Adam updated PPI for Perl 5.010. At
any rate, I have added a non-TODO test for this to
t/Subroutines/RequireFinalReturn.run, and it passes with the
Perl::Critic trunk as of this commit, and PPI 1.208.

10 years agoRT 52029: state should be allowed by Perl::Critic::Policy::CodeLayout::ProhibitParens...
Tom Wyant [Wed, 20 Jan 2010 04:25:37 +0000 (04:25 +0000)] 
RT 52029: state should be allowed by Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins

Forgot to update the Changes file. Sorry. The rest was committed as revision 3752.

10 years agoRT 52029: state should be allowed by Perl::Critic::Policy::CodeLayout::ProhibitParens...
Tom Wyant [Wed, 20 Jan 2010 01:44:15 +0000 (01:44 +0000)] 
RT 52029: state should be allowed by Perl::Critic::Policy::CodeLayout::ProhibitParensWithBuiltins

The minimal implementation of adding 'state' to @ALLOWED seemed the
best. If 'state' is not a builtin, by definition it is not subject to
this policy. If it is a builtin, Perl requires the parens if multiple
variables are specified, same as for 'my', so the parens should not be a
violation.

Added a test for this to t/CodeLayout/ProhibitParensWithBuiltins.run.

10 years agoRemoved all uses of Perl::Critic::Utils::PPIRegep. Since the replacement
Tom Wyant [Sun, 17 Jan 2010 18:11:14 +0000 (18:11 +0000)] 
Removed all uses of Perl::Critic::Utils::PPIRegep. Since the replacement
of Regexp::Parser with PPIx::Regexp, the only subroutines from this
module used by Perl::Critic were get_match_string() and friends. These
were superseded by the corresponding PPI methods, introduced in PPI
1.208. At this point, I believe Perl::Critic no longer needs
Perl::Critic::Utils::PPIRegexp at all.

10 years agoCorrect typo in Changes file.
Tom Wyant [Sun, 17 Jan 2010 13:59:07 +0000 (13:59 +0000)] 
Correct typo in Changes file.

10 years agoExtend all copyrights by one more year. v1.105_001
Jeffrey Ryan Thalhammer [Sat, 16 Jan 2010 19:48:41 +0000 (19:48 +0000)] 
Extend all copyrights by one more year.

10 years agoAdd banner to Changes file, proclaiming this is a developer release.
Jeffrey Ryan Thalhammer [Sat, 16 Jan 2010 19:28:48 +0000 (19:28 +0000)] 
Add banner to Changes file, proclaiming this is a developer release.

10 years agoBumped VERSION to 1.105_001. Getting ready to make development release.
Jeffrey Ryan Thalhammer [Sat, 16 Jan 2010 19:22:15 +0000 (19:22 +0000)] 
Bumped VERSION to 1.105_001.  Getting ready to make development release.

10 years agoAdd TODO to take advantage of the get_match_string(),
Tom Wyant [Sat, 16 Jan 2010 17:25:26 +0000 (17:25 +0000)] 
Add TODO to take advantage of the get_match_string(),
get_substitute_string(), get_modifiers(), and get_delimiters() methods
added to PPI::Token::Regexp and PPI::Token::QuoteLike::Regexp.

10 years agoModify the annotation parsing so that things like
Tom Wyant [Sat, 2 Jan 2010 19:44:05 +0000 (19:44 +0000)] 
Modify the annotation parsing so that things like
  my $foo =
    '$bar'; ## no critic (RequireInterpolationOfMetachars)

are parsed as line annotations rather than block annotations. Test
t/03_annotations.t was added to test this, since I was too lazy to
recode the tests into t/03_pragmas.t.

The statement in P::C::P::Variables::ProhibitPunctuationVars that was
modified (strangely) to work around the old behavior has been put back
the way it was, and the prolix comment on the strange coding removed.

10 years agoModify MANIFEST.SKIP and the top level directory's svn:ignore to ignore
Tom Wyant [Thu, 31 Dec 2009 16:36:34 +0000 (16:36 +0000)] 
Modify MANIFEST.SKIP and the top level directory's svn:ignore to ignore
MYMETA.yml, which is generated by 0.36 and up.

10 years agoReview commit log for my commits since r3149 (the last time I touched
Tom Wyant [Thu, 24 Dec 2009 22:09:21 +0000 (22:09 +0000)] 
Review commit log for my commits since r3149 (the last time I touched
Changes) and update the Changes file to describe what I was trying to do.

10 years agoAdd hint on figuring out what word with punctuation is misspelled to
Elliot Shank [Thu, 24 Dec 2009 01:11:12 +0000 (01:11 +0000)] 
Add hint on figuring out what word with punctuation is misspelled to
PodSpelling documentation.

10 years agoFix prerequisites in Perl::Critic POD.
Elliot Shank [Thu, 24 Dec 2009 00:53:22 +0000 (00:53 +0000)] 
Fix prerequisites in Perl::Critic POD.

10 years agoAdd note to Subroutines::RequireFinalReturn about it not handling
Elliot Shank [Thu, 24 Dec 2009 00:41:56 +0000 (00:41 +0000)] 
Add note to Subroutines::RequireFinalReturn about it not handling
given/when/default.

10 years agoChange Subroutines::ProhibitNestedSubs to not complain about
Elliot Shank [Thu, 24 Dec 2009 00:30:42 +0000 (00:30 +0000)] 
Change Subroutines::ProhibitNestedSubs to not complain about
subroutines in scheduled blocks and vice versa.

10 years agoPunctuation change in test name in Subroutines/ProtectPrivateSubs.run.
Elliot Shank [Thu, 24 Dec 2009 00:07:09 +0000 (00:07 +0000)] 
Punctuation change in test name in Subroutines/ProtectPrivateSubs.run.

10 years agoChange Subroutines::ProtectPrivateSubs to allow calling public methods
Elliot Shank [Thu, 24 Dec 2009 00:06:18 +0000 (00:06 +0000)] 
Change Subroutines::ProtectPrivateSubs to allow calling public methods
on non-public classes.

10 years agoAdd TODO tests to TestingAndDebugging/RequireUseStrict.run for "use
Elliot Shank [Wed, 23 Dec 2009 23:56:54 +0000 (23:56 +0000)] 
Add TODO tests to TestingAndDebugging/RequireUseStrict.run for "use
5.011".

10 years agoUpdate TODO about multiple namespace support in P::C.
Elliot Shank [Wed, 23 Dec 2009 23:43:58 +0000 (23:43 +0000)] 
Update TODO about multiple namespace support in P::C.

10 years agoAdd an entry to TODO.pod for the problem that in
Tom Wyant [Tue, 15 Dec 2009 05:16:23 +0000 (05:16 +0000)] 
Add an entry to TODO.pod for the problem that in

my $foo =
   '$bar'; ## no critic (RequireInterpolationOfMetachars)

the annotation is taken to be a block annotation, not a single-line
annotation. This was found when working on RT 52038. There was a TODO in
the code at the appropriate point, but I thought the issue needed a
little more prominence.

10 years agoRT 52038. The _parse_annotation() method of Perl::Critic::Annotation now
Tom Wyant [Tue, 15 Dec 2009 05:08:37 +0000 (05:08 +0000)] 
RT 52038. The _parse_annotation() method of Perl::Critic::Annotation now
greps out any potential match patterns equal to the empty string.

Perl::Critic;:Policy::Variables::ProhibitPunctuationVars had
self-compliance problems once the above modification was made, and those
had to be fixed.

10 years agoHave InputOutput::RequireBriefOpen recognize 'CORE::open' and
Tom Wyant [Tue, 15 Dec 2009 02:52:17 +0000 (02:52 +0000)] 
Have InputOutput::RequireBriefOpen recognize 'CORE::open' and
'CORE::GLOBAL::open' as being equivalent to 'open'. This is in response
to RT ticket 52391. Commit 3730 added the requisite tests to
t/InputOutput/RequireBriefOpen.run.

10 years agoFailing tests for RT #52391.
Elliot Shank [Thu, 3 Dec 2009 13:52:50 +0000 (13:52 +0000)] 
Failing tests for RT #52391.

10 years agoFix McCabe violation in P::C::P::RegularExpressions::ProhibitUnusedCapture.
Tom Wyant [Mon, 23 Nov 2009 05:14:40 +0000 (05:14 +0000)] 
Fix McCabe violation in P::C::P::RegularExpressions::ProhibitUnusedCapture.

In the same module, discovered a failure to recognize unused named
captures when a regular expression used all its numbered captures (e.g.
s/(?<foo>\w+)/Foo$1/). Fixed, and added tests.

10 years agoAdd stuff from 5.11 into TODO.pod, to give (I hope) a starting point for
Tom Wyant [Mon, 23 Nov 2009 04:33:09 +0000 (04:33 +0000)] 
Add stuff from 5.11 into TODO.pod, to give (I hope) a starting point for
5.12 once we get 5.10 subdued.

10 years agoMake P::C::P::RegularExpressions::ProhibitUnusedCapture Handle the case
Tom Wyant [Sat, 21 Nov 2009 02:06:25 +0000 (02:06 +0000)] 
Make P::C::P::RegularExpressions::ProhibitUnusedCapture Handle the case
where a capture name occurs more than once in the regexp.

Since we do not know which capture number a given name refers to, we
simply mark all numbers corresponding to the given name as having been
used.

10 years agoAdd named capture support, at least somewhat.
Tom Wyant [Fri, 20 Nov 2009 01:55:11 +0000 (01:55 +0000)] 
Add named capture support, at least somewhat.

10 years agoAdd note in POD of Documentation::PodSpelling about aspell's tendency
Elliot Shank [Thu, 19 Nov 2009 22:12:52 +0000 (22:12 +0000)] 
Add note in POD of Documentation::PodSpelling about aspell's tendency
to only emit part of misspelled words containing punctuation.

10 years agoChange RequirePackageDeclaration to
Elliot Shank [Sat, 14 Nov 2009 03:45:53 +0000 (03:45 +0000)] 
Change RequirePackageDeclaration to
RequirePackageDeclarationAsFirstStatementInModule in TODO.pod.

10 years agoAdd Modules::RequirePackageDeclaration to TODO.pod.
Elliot Shank [Tue, 10 Nov 2009 18:36:21 +0000 (18:36 +0000)] 
Add Modules::RequirePackageDeclaration to TODO.pod.

10 years agoRedo on the policy summary generator. This time, choose an
Tom Wyant [Mon, 9 Nov 2009 20:23:01 +0000 (20:23 +0000)] 
Redo on the policy summary generator. This time, choose an
implementation with a chance of working under Perl 5.6.
Also revise xt/author/80_policysummary.t so that it
recognizes the contents of the new policy summary.

10 years agoGenerate the links in the policy summary as L<Foo|Foo> rather than as
Tom Wyant [Mon, 9 Nov 2009 19:06:01 +0000 (19:06 +0000)] 
Generate the links in the policy summary as L<Foo|Foo> rather than as
L<Foo>.

10 years agoFurther tweak docs.
Tom Wyant [Mon, 9 Nov 2009 18:57:43 +0000 (18:57 +0000)] 
Further tweak docs.

My read on pod2html is that it does _not_ recognize C<< L<Foo> >> as
containing a link, but neither does it format it the way one (at least
this one) would like.

And who knows what goes on in the minds and hearts of other (or older)
POD translaters? The Shadow may, but I haven't a clue.

10 years agoRenamed POD -> Pod, to be consistent with the naming
Jeffrey Ryan Thalhammer [Sun, 8 Nov 2009 08:10:37 +0000 (08:10 +0000)] 
Renamed POD -> Pod, to be consistent with the naming
of our other documentation-related policies.

10 years agoChanged literal POD fragments so they appear like POD, rather
Jeffrey Ryan Thalhammer [Sun, 8 Nov 2009 08:04:01 +0000 (08:04 +0000)] 
Changed literal POD fragments so they appear like POD, rather
than getting formatted.  I think this is what Tom probably wanted.
But I don't know how this looks on other versions of the POD formatter.

10 years agoAdd Perl::Critic::Policy::Documentation::RequirePODLinksIncludeText, and
Tom Wyant [Sat, 7 Nov 2009 23:35:55 +0000 (23:35 +0000)] 
Add Perl::Critic::Policy::Documentation::RequirePODLinksIncludeText, and
associated .run file. Remove this item from TODO.pod.

10 years agoChange all instances of L<Foo> in the POD to L<Foo|Foo>. Or at least,
Tom Wyant [Sat, 7 Nov 2009 23:32:40 +0000 (23:32 +0000)] 
Change all instances of L<Foo> in the POD to L<Foo|Foo>. Or at least,
all such that I could find. Left alone L<Foo/bar> and L</bar>.

10 years agoReplace Regexp::Parser with PPIx::Regexp in t/RegularExpressions/*.run.
Tom Wyant [Sat, 7 Nov 2009 15:50:02 +0000 (15:50 +0000)] 
Replace Regexp::Parser with PPIx::Regexp in t/RegularExpressions/*.run.

Without this, if you "upgrade" to r3704 you can't test the relevant
modules unless you actually have PPIx::Regexp installed

10 years agoConvert Perl::Critic from using Regexp::Parser for regular expression
Tom Wyant [Tue, 3 Nov 2009 00:53:25 +0000 (00:53 +0000)] 
Convert Perl::Critic from using Regexp::Parser for regular expression
analysis to using PPIx::Regxp. Besides the P::C::P::RegularExpressions
modules, collateral changes were made in Perl::Critic (to flush the
cached regular expression parses after criticism is complete).

The new parser introduced self-compliance problems in:
 xt/author/93_version.t
 lib/Perl/Critic/Document.pm
 lib/Perl/Critic/Policy/CodeLayout/RequireConsistentNewlines.pm
 lib/Perl/Critic/Policy/Modules/ProhibitEvilModules.pm
which are addressed in this commit.

Obviously this commit adds PPIx::Regexp as an optional module. But
Regexp::Parser is _not_ dropped, because the relevant subroutines
in P::C::U::PPIRegexp (parse_regexp and ppiify) need to be put
through a deprecation cycle.

10 years agoIn TODO for ValuesAndExpressions::RequireInterpolatedStringyEval, note
Tom Wyant [Mon, 2 Nov 2009 16:17:27 +0000 (16:17 +0000)] 
In TODO for ValuesAndExpressions::RequireInterpolatedStringyEval, note
the similarity of this to BuiltInFunctions::ProhibitStringyEval, and
wonder whether an option on the latter (to prohibit un-interpolated
strings even if allow_includes is turned on) would do the job.

10 years agoFix example in BuiltinFunctions::RequireGlobFunction as commented on
Elliot Shank [Mon, 2 Nov 2009 01:34:34 +0000 (01:34 +0000)] 
Fix example in BuiltinFunctions::RequireGlobFunction as commented on
at AnnoCPAN.

10 years agoLink to Chas. Owens' post in P::C::DEVELOPER.
Elliot Shank [Mon, 2 Nov 2009 01:32:08 +0000 (01:32 +0000)] 
Link to Chas. Owens' post in P::C::DEVELOPER.

10 years agoAdd link to Alexandr Ciornii's executable in Perl::Critic's POD.
Elliot Shank [Mon, 2 Nov 2009 01:28:34 +0000 (01:28 +0000)] 
Add link to Alexandr Ciornii's executable in Perl::Critic's POD.

10 years agoMerge my long-uncommitted Policy::is_unsafe() stuff with Jeff's
Elliot Shank [Mon, 2 Nov 2009 01:13:44 +0000 (01:13 +0000)] 
Merge my long-uncommitted Policy::is_unsafe() stuff with Jeff's
is_safe().

10 years agoForgot to add the requisite properties to ProhibitUnusedPrivateSubroutines.pm
Tom Wyant [Sat, 31 Oct 2009 20:19:11 +0000 (20:19 +0000)] 
Forgot to add the requisite properties to ProhibitUnusedPrivateSubroutines.pm
and .run.

10 years agoMake sub _parse_private_name_regex() the parser for parameter
Tom Wyant [Sat, 31 Oct 2009 20:12:55 +0000 (20:12 +0000)] 
Make sub _parse_private_name_regex() the parser for parameter
private_name_regex in P::C::P::Subroutines::ProhibitUnusedPrivateSubroutines.

Remove the negative lookahead assertion on 'parse_' in the
ProhibitUnusedPrivateSubroutines setup, since with the above fix and the
previous one on ProtectPrivateSubs it is no longer needed.

10 years agoMake sub _parse_private_name_regex() the custom parser for the
Tom Wyant [Sat, 31 Oct 2009 20:10:07 +0000 (20:10 +0000)] 
Make sub _parse_private_name_regex() the custom parser for the
private_name_regex parameter.

10 years agoImplement the TODO item P::C::P::Subroutines::ProhibitUnusedPrivateSubroutines.
Tom Wyant [Sat, 31 Oct 2009 02:28:53 +0000 (02:28 +0000)] 
Implement the TODO item P::C::P::Subroutines::ProhibitUnusedPrivateSubroutines.
This takes the same configuration parameters as
P::C::P::Subroutines::ProtectPrivateSubroutines.

Changes in other modules were self-compliance issues, which were solved by
removing the subroutines that were found in violation (after checking with
'ack' to see if they were truly not referred to!):
  - Perl::Critic::Policy::_get_source_file;
  - Perl::Critic::PolicyConfig::_validate_maximum_violations_per_document;
  - Perl::Critic::Policy::Documentation::PodSpelling::_set_spell_command;
  - Perl::Critic::Policy::NamingConventions::Capitalization::_local_variable.

There appear to be a couple distribution-private subroutines whose names
begin with single underscores:
  - Perl::Critic::PolicyParameter::_get_behavior_values;
  - Perl::Critic::PolicyParameter::_get_description_with_trailing_period.
These were dealt with by adding them to the 'accept' list in
xt/author/40_perlcriticrc-code.

10 years agoAdd idea for Subroutines::ProhibitUnusedPrivateSubroutines to
Elliot Shank [Thu, 29 Oct 2009 03:53:12 +0000 (03:53 +0000)] 
Add idea for Subroutines::ProhibitUnusedPrivateSubroutines to
TODO.pod.

10 years agoAdded test case for RT #50910. It appears that we already handle
Jeffrey Ryan Thalhammer [Wed, 28 Oct 2009 17:02:39 +0000 (17:02 +0000)] 
Added test case for RT #50910.  It appears that we already handle
this case properly, but I thought it would be good to add, just
to catch future regressions.

11 years agoUpdate VERSION numbers on files that were created on trunk
Jeffrey Ryan Thalhammer [Sat, 24 Oct 2009 20:07:24 +0000 (20:07 +0000)] 
Update VERSION numbers on files that were created on trunk
after the backlog branch was first made.

11 years agoFix PBP page numbers in
Elliot Shank [Fri, 23 Oct 2009 22:06:55 +0000 (22:06 +0000)] 
Fix PBP page numbers in
ValuesAndExpressions::ProhibitEscapedCharacters.  (Yup, just ran into
this at work and looked it up, saying "What does this have to do with
character escapes?".)

11 years agoWoops. I forgot to correct the test count.
Jeffrey Ryan Thalhammer [Thu, 15 Oct 2009 22:14:00 +0000 (22:14 +0000)] 
Woops.  I forgot to correct the test count.

11 years agoAdded support for the -unsafe switch. This is to protect
Jeffrey Ryan Thalhammer [Thu, 15 Oct 2009 21:10:02 +0000 (21:10 +0000)] 
Added support for the -unsafe switch.  This is to protect
users from accidentally running unsafe dynamic policies
over untrusted code.  The idea was inspired by Sartak, who
has written several dynamic Moose-related policies.
He said he would release them once we had created some
kind of safety mechanism on dynamic policies like his.

11 years agoMerge r3677 to the backlog branch. Remove the ability to specify
Elliot Shank [Fri, 2 Oct 2009 22:56:30 +0000 (22:56 +0000)] 
Merge r3677 to the backlog branch.  Remove the ability to specify
modifiers on the end of configured regular expressions. Instead,
document how it can be done with (?i: ... ).

11 years agoMerge r3645 to the backlog branch. The "## no critic" annotations are
Elliot Shank [Fri, 2 Oct 2009 22:52:13 +0000 (22:52 +0000)] 
Merge r3645 to the backlog branch.  The "## no critic" annotations are
now effective as-of their logical line numbers.  I think this is the
right thing to do, but I'm not completely sure.  Comments?

11 years agoMerge r364[34] to the backlog branch.
Elliot Shank [Fri, 2 Oct 2009 22:38:17 +0000 (22:38 +0000)] 
Merge r364[34] to the backlog branch.

Fixed spelling error.

I guess "subscripted" is not in the dictionary either.

11 years agoMerge r363[89] to the backlog branch.
Elliot Shank [Fri, 2 Oct 2009 22:35:35 +0000 (22:35 +0000)] 
Merge r363[89] to the backlog branch.

Turned PolicySummary.pod.PL into a "policysummary" action in
P::C::Module::Build.  The intent is move the generation of
PolicySummary.pod from a build-time event to a distro-creation-time
event.  That way, the file will be present in the distribution and
available on http://search.cpan.org.

Changed the POD in P::C::Module::Build so that it can automatically
generate online documentation for each of the custom actions.  For
example, when you say: "./Build help authortest".

If the actions are not listed as =items within the ACTION section of
the POD, then it doesn't work.

11 years agoMerge r3469, r347[1-4], and r3564 to the backlog branch.
Elliot Shank [Fri, 2 Oct 2009 22:31:13 +0000 (22:31 +0000)] 
Merge r3469, r347[1-4], and r3564 to the backlog branch.

Moved the guts of 20_policies.t into a new module called
Test::Perl::Critic::Policy.  This makes it easier for third-party
developers to test their own Policies.

I refactored much of the code into smaller subroutines, but the
mechanics are still pretty much the same.

Fixed T::P::C::Policy to workaround inconsisten behavior in various
versions of List::MoreUtils::none().

Doh!  Try again.

Note that T::P::C::Policy needs unit tests

Improve readability of diagnostic messages

Fix spelling errors.

11 years agoMerge r3455 to the backlog branch. A few more isa_ok tests to verify
Elliot Shank [Fri, 2 Oct 2009 22:03:56 +0000 (22:03 +0000)] 
Merge r3455 to the backlog branch.  A few more isa_ok tests to verify
the ancestry of the Perl::Critic::Document facade.

11 years agoFix current subversion version and indent the code blocks by the
Elliot Shank [Fri, 2 Oct 2009 21:55:47 +0000 (21:55 +0000)] 
Fix current subversion version and indent the code blocks by the
standard amount in CORE_DEVELOPER.

11 years agoMerge r3651 to the backlog branch. This file contains a (very
Elliot Shank [Fri, 2 Oct 2009 21:46:34 +0000 (21:46 +0000)] 
Merge r3651 to the backlog branch.  This file contains a (very
slightly) updated version of the letter I wrote early in the year
about how to get started developing, plus notes on adding global
configuration items/command options, and how to deprecate code.

11 years agoMerge r3650 to the backlog branch. RT #49500: From Debian:
Elliot Shank [Fri, 2 Oct 2009 21:45:26 +0000 (21:45 +0000)] 
Merge r3650 to the backlog branch.  RT #49500: From Debian:
RequireBracedFileHandleWithPrint don't recognize "say $fh".  Added
'say' to $PRINT_RX, and some tests to the .run file.

11 years agoMerge r3648 to the backlog branch. RT 49609:
Elliot Shank [Fri, 2 Oct 2009 21:41:49 +0000 (21:41 +0000)] 
Merge r3648 to the backlog branch.  RT 49609:
Subroutines::ProhibitAmpersandSigils improperly interprets list of sub
refs. The perlref document states that '\( a )' is equivalent to '(
\a)', and a little fiddling with YAML suggests that '\( ( a ) )' is
too.  So this revision makes the policy return on finding a list
preceded by a backslash cast.

11 years agoMerge r3646 to the backlog branch. I just realized my fix for RT
Elliot Shank [Fri, 2 Oct 2009 21:33:22 +0000 (21:33 +0000)] 
Merge r3646 to the backlog branch.  I just realized my fix for RT
36098 (RegularExpressions::ProhibitComplexRegexes should not penalize
long variable names) was not taking account of whether the regexp was
in fact interpolated before it applied its nasty hack. As a result,
P::C::Utils::PPIRegexp has grown a regexp_interpolates() subroutine
(true unless the first delimiter character is "'"), which is consulted
in ProhibitComplexRegexes before doing the dirty deed. The .run file
has grown a test to try to guard against regressions.

11 years agoMerge r3632 to the backlog branch. Most of 'RT 36081 redux'. The
Elliot Shank [Fri, 2 Oct 2009 00:01:36 +0000 (00:01 +0000)] 
Merge r3632 to the backlog branch.  Most of 'RT 36081 redux'. The
'next', 'last', 'redo', and 'return' verbs are handled pretty much the
same way as 'die' and friends, though they live in an internal hash
rather than a configuration variable. The 'goto' verb is another
kettle of fish. The updated code accepts 'goto &foo' unconditionally,
and 'goto LABEL' unless the label appears between the regex and the
capture variable. 'goto EXPRESSION' is still rejected. Also added
ability to handle 'die unless m/(foo)/' from the BUGS section of the
POD. Did not attempt 'when'. Revised POD accordingly, including weasel
words about how complicated the conditionals can be (not very!) before
the policy fails to understand them.

11 years agoFix $VERSION in Variables::ProhibitEvilVariables.
Elliot Shank [Thu, 1 Oct 2009 23:40:51 +0000 (23:40 +0000)] 
Fix $VERSION in Variables::ProhibitEvilVariables.

11 years agoMerge r3621 to the backlog branch. For what it isi (or is not) worth,
Elliot Shank [Thu, 1 Oct 2009 23:33:08 +0000 (23:33 +0000)] 
Merge r3621 to the backlog branch.  For what it isi (or is not) worth,
here is ProhibitEvilVariables. I took the coward's way out and
provided no evil variables by default. Note that we need some help
from PPI before variables of the form ${^_foo} can be made evil; see
PPI RT 49472.

11 years agoMerge r3620 to the backlog branch. Fix regression on 'use VERSION'.
Elliot Shank [Thu, 1 Oct 2009 23:19:28 +0000 (23:19 +0000)] 
Merge r3620 to the backlog branch.  Fix regression on 'use VERSION'.

11 years agoRename $P::C::Utils::Constants::MODULE_VERSION_TERM_ANSICOLOR to
Elliot Shank [Thu, 1 Oct 2009 22:54:20 +0000 (22:54 +0000)] 
Rename $P::C::Utils::Constants::MODULE_VERSION_TERM_ANSICOLOR to
$_MODULE_VERSION_TERM_ANSICOLOR and remove the POD for it.  This isn't
something that should be in our public interface.

11 years agoMerge r3619 to the backlog branch. Validate colors using the new
Elliot Shank [Thu, 1 Oct 2009 22:44:40 +0000 (22:44 +0000)] 
Merge r3619 to the backlog branch.  Validate colors using the new
Term::ANSIColor colorvalid() subroutine. All places where
Term::ANSIColor is loaded now check the version of the loaded code,
and ignore Term::ANSIColor if the version is too low. The version
number is centralized to P::C::Utils::Constants because of
ProhibitMagicNumbers violations, and because it seems the Right Thing.
Comments cross-reference the the definition of
$MODULE_VERSION_TERM_ANSICOLOR in P::C::Utils::Constants to the
corresponding value used in inc/Perl/Critic/BuildUtilities.pm.

11 years agoMerge r3637 to the backlog branch. Use my imaginative-software.com
Elliot Shank [Thu, 1 Oct 2009 00:35:26 +0000 (00:35 +0000)] 
Merge r3637 to the backlog branch.  Use my imaginative-software.com
e-mail address everywhere.

11 years agoMerge r3636 to the backlog branch. Assigned the COPYRIGHT to
Elliot Shank [Thu, 1 Oct 2009 00:32:21 +0000 (00:32 +0000)] 
Merge r3636 to the backlog branch.  Assigned the COPYRIGHT to
Imaginative Software Systems in all files where I was named as the
copyright holder.  I'm doing this to increase the marketing affinity
between Imaginative and Perl::Critic, and to help increase search
hits.

11 years agoMerge r3448, r3615, r3616, and r3649 to the backlog branch.
Elliot Shank [Thu, 1 Oct 2009 00:24:24 +0000 (00:24 +0000)] 
Merge r3448, r3615, r3616, and r3649 to the backlog branch.

Assign blame to correct person

Since PPI 1.206 still mistakes constructors for blocks in some (though
fewer) cases, comment code which is hacked to work around this, and
add a test to see when the problem is finally fixed.

Correct name of routine to be fixed when test passes.

Join broken NAME line.

11 years agoMert r3442 to the backlog branch. Add
Elliot Shank [Thu, 1 Oct 2009 00:11:47 +0000 (00:11 +0000)] 
Mert r3442 to the backlog branch.  Add
Perl::Critic::PPIx::Utilities::Statement, and in it
get_constant_name_elements_from_declaring_statement(). Deprecate
Perl::Critic::Utils::PPI::get_constant_name_element_from_declaring_statement().

11 years agoMerge r3313 to the backlog branch. Merge STDERR into STDOUT, so
Elliot Shank [Wed, 30 Sep 2009 00:56:30 +0000 (00:56 +0000)] 
Merge r3313 to the backlog branch.  Merge STDERR into STDOUT, so
TeamCity can see diagnostic messages.

11 years agoGet rid of P::C::Document::document_type() and just leave
Elliot Shank [Wed, 30 Sep 2009 00:43:30 +0000 (00:43 +0000)] 
Get rid of P::C::Document::document_type() and just leave
is_module()/is_program().

11 years agoRename the "--script-extensions" parameter to "--program-extensions"
Elliot Shank [Wed, 30 Sep 2009 00:32:43 +0000 (00:32 +0000)] 
Rename the "--script-extensions" parameter to "--program-extensions"
and otherwise try to get rid of all use of the word "script".

11 years agoMerge r3375, r3376, and r3381 to the backlog branch.
Elliot Shank [Tue, 29 Sep 2009 23:44:40 +0000 (23:44 +0000)] 
Merge r3375, r3376, and r3381 to the backlog branch.

Add command option --document-type and configuration item
script-extensions, both in aid of configuring perlcritic's idea of
which documents are scripts and which documents are modules.

Add command option --script-extensions, which can be specified
multiple times. Make Perl::Critic::Document->new() take keyword
arguments; the old interface still works but is deprecated. The
Perl::Critic::Document document_type() method is now an accessor only;
there is no mutator.

Remove --document-type command option, -document-type
Perl::Critic::Document->new() argument, everything in between, and
everything to support them. I think.

11 years agoBump the P::C version to 1.105. v1.105
Elliot Shank [Mon, 7 Sep 2009 21:19:21 +0000 (21:19 +0000)] 
Bump the P::C version to 1.105.

11 years agoChange InputOutput::RequireCheckedSyscalls to complain about "say" by
Elliot Shank [Mon, 7 Sep 2009 21:08:20 +0000 (21:08 +0000)] 
Change InputOutput::RequireCheckedSyscalls to complain about "say" by
default.  RT #37487

11 years agoFix RT #49016. Variables::ProhibitPunctuationVars would complain
Elliot Shank [Mon, 7 Sep 2009 20:59:49 +0000 (20:59 +0000)] 
Fix RT #49016.  Variables::ProhibitPunctuationVars would complain
about things that looked like references to magic hashes in strings,
however, without doing ye olde code interpolation via array reference
hack, you can't expand entire hashes in strings.

11 years agoMerge r3614 to the backlog branch. Correct presumptive typo in
Elliot Shank [Mon, 7 Sep 2009 19:49:56 +0000 (19:49 +0000)] 
Merge r3614 to the backlog branch.  Correct presumptive typo in
"emaila addresses".

11 years agoRemove incorrect comment in Changes that
Elliot Shank [Mon, 7 Sep 2009 19:45:11 +0000 (19:45 +0000)] 
Remove incorrect comment in Changes that
ProhibitInterpolationOfLiterals uses Email::Address.

11 years agoIn ValuesAndExpressions::RequireInterpolationOfMetachars, change the
Elliot Shank [Wed, 2 Sep 2009 02:44:07 +0000 (02:44 +0000)] 
In ValuesAndExpressions::RequireInterpolationOfMetachars, change the
block eval of a require of Email::Address to a string eval of a use of
a Email::Address so that we can specify a minimum version.

11 years agoAdd missing "on" to Changes on the backlog branch.
Elliot Shank [Sun, 23 Aug 2009 21:54:35 +0000 (21:54 +0000)] 
Add missing "on" to Changes on the backlog branch.

11 years agoBump P::C version to 1.104. v1.104
Elliot Shank [Sun, 23 Aug 2009 21:18:28 +0000 (21:18 +0000)] 
Bump P::C version to 1.104.

11 years agoUnsurprisingly, there were some self-compliance issues with the recent
Elliot Shank [Sun, 23 Aug 2009 20:59:29 +0000 (20:59 +0000)] 
Unsurprisingly, there were some self-compliance issues with the recent
change to Variables::ProhibitPunctuationVars.

11 years agoTest in t/Subroutines/RequireFinalReturn.run is no longer TODO and
Elliot Shank [Sun, 23 Aug 2009 20:50:01 +0000 (20:50 +0000)] 
Test in t/Subroutines/RequireFinalReturn.run is no longer TODO and
TODO test in t/Variables/ProhibitPunctuationVars.run had all of its
code commented out, which meant that it was "passing" when it
shouldn't have.

11 years agoRecent change to ValuesAndExpressions::ProhibitVersionStrings wasn't
Elliot Shank [Sun, 23 Aug 2009 20:28:31 +0000 (20:28 +0000)] 
Recent change to ValuesAndExpressions::ProhibitVersionStrings wasn't
checking perl version requirement statements.

11 years agoAdd is_script to the imports in
Elliot Shank [Sun, 23 Aug 2009 20:06:23 +0000 (20:06 +0000)] 
Add is_script to the imports in
Modules::RequireFilenameMatchesPackage.  I must have accidentally
gotten part of Tom's changes into the backlog branch.

11 years agoFix Variables::ProhibitPunctuationVars reference to non-public
Elliot Shank [Sun, 23 Aug 2009 19:49:38 +0000 (19:49 +0000)] 
Fix Variables::ProhibitPunctuationVars reference to non-public
variable in PPI::Token::Magic.