Login
Jeffrey Ryan Thalhammer [Mon, 24 Nov 2008 06:26:52 +0000 (06:26 +0000)]
Spelling fixes and stopwords.
Jeffrey Ryan Thalhammer [Mon, 24 Nov 2008 05:34:44 +0000 (05:34 +0000)]
Adding a few stopwords
Jeffrey Ryan Thalhammer [Mon, 24 Nov 2008 05:26:58 +0000 (05:26 +0000)]
Add a little explanation about the way we've mishandled
the parsing of "## no critic" restrictions.
Jeffrey Ryan Thalhammer [Mon, 24 Nov 2008 05:06:47 +0000 (05:06 +0000)]
Added new policy: ProhibitReturnSort, as suggested by Ulrich Wisser.
I hadn't anticipated the problem with false-positives due to wantarray().
I don't know if this issue is a release-blocker. What do you think?
Jeffrey Ryan Thalhammer [Mon, 24 Nov 2008 05:04:45 +0000 (05:04 +0000)]
Now that we have ProhibitUselessNoCritic, we can
scratch one more item off the TODO list!
Jeffrey Ryan Thalhammer [Mon, 24 Nov 2008 04:56:47 +0000 (04:56 +0000)]
Can scratch one item off the todo list...
Jeffrey Ryan Thalhammer [Mon, 24 Nov 2008 04:52:17 +0000 (04:52 +0000)]
Added idea about refactoring F<perlcritic> to the TODO list.
Elliot Shank [Sun, 23 Nov 2008 21:09:26 +0000 (21:09 +0000)]
Test all the standard Capitalization schemes. Regexes aren't tested
yet, nor are all kinds of names, e.g. labels.
Elliot Shank [Sun, 23 Nov 2008 18:29:04 +0000 (18:29 +0000)]
Progress on Capitalization tests.
Elliot Shank [Sun, 23 Nov 2008 18:20:50 +0000 (18:20 +0000)]
Update Changes.
Elliot Shank [Sun, 23 Nov 2008 18:16:54 +0000 (18:16 +0000)]
Add exclude_functions parameter to RequireCheckedSyscalls.
Elliot Shank [Sun, 23 Nov 2008 18:06:58 +0000 (18:06 +0000)]
Mention parent in the POD for ProhibitExplicitISA.
Elliot Shank [Sun, 23 Nov 2008 18:01:18 +0000 (18:01 +0000)]
Mention IPC::System::Simple in the ProhibitBacktickOperators POD.
Elliot Shank [Fri, 14 Nov 2008 04:51:14 +0000 (04:51 +0000)]
Handle standard filehandle names in NamingConventions::Capitalization
by not reinventing the wheel.
Elliot Shank [Wed, 12 Nov 2008 05:33:13 +0000 (05:33 +0000)]
POD updates in NamingConventions::Capitalization.
Elliot Shank [Wed, 12 Nov 2008 03:43:02 +0000 (03:43 +0000)]
Handle labels in NamingConventions::Capitalization.
Jeffrey Ryan Thalhammer [Mon, 10 Nov 2008 07:06:17 +0000 (07:06 +0000)]
Re-characterizing the "## no critic" comments/pragmas as "annotations" throughout the code and documentation.
Jeffrey Ryan Thalhammer [Mon, 10 Nov 2008 04:58:56 +0000 (04:58 +0000)]
Renaming test scripts for readability, as Elliot had done for some of the others.
Jeffrey Ryan Thalhammer [Mon, 10 Nov 2008 04:43:41 +0000 (04:43 +0000)]
Committing the rest of my work on refactoring the handling of the
"## no critic" annotations. This completes the integration with the
new Annotation class.
I also created a new ProhibitUselessNoCritic policy, which uses the
new capabilities of P::C::Document and P::C::Annotation to effectively
replace the --warn-about-useless-no-critc option. Thanks Elliot for i
suggesting that we implement this as a Policy instead of an option.
Next, I want to change all the code and documentation to recharacterize
the "## no critic" thingies as "annotations". Also need to write some
unit tests for P::C::Annotation and P::C::Document. I've had success
using Test::Class at work lately, so I'm thinking of using it here.
Elliot Shank [Sat, 8 Nov 2008 15:09:22 +0000 (15:09 +0000)]
Add optional modules used in tests to 82_optional_modules.t.
Elliot Shank [Sat, 8 Nov 2008 15:04:44 +0000 (15:04 +0000)]
Get rid of most conditional loading of modules in xt/author tests. If
you're an author, these modules are required, not optional. Plus, it
makes the code simpler.
Elliot Shank [Sun, 2 Nov 2008 17:25:55 +0000 (17:25 +0000)]
Change regex delimiters in P::C::Document in order to passify editor
syntax highlighting.
Elliot Shank [Thu, 30 Oct 2008 16:20:47 +0000 (16:20 +0000)]
Bump P::C version number for developer release. Unfortunately, I
screwed up last time and left a zero out of the version, so this is
version 1.093_02 instead of 1.093_002.
Elliot Shank [Thu, 30 Oct 2008 16:16:37 +0000 (16:16 +0000)]
Update Changes for developer release.
Elliot Shank [Thu, 30 Oct 2008 16:09:31 +0000 (16:09 +0000)]
Fix self compliance of P::C::(Violation|Annotation).
Elliot Shank [Thu, 30 Oct 2008 16:09:02 +0000 (16:09 +0000)]
Mark failing test for CodeLayout::ProhibitParensWithBuiltins as TODO
so that I can do a developer release.
Jeffrey Ryan Thalhammer [Thu, 30 Oct 2008 05:21:33 +0000 (05:21 +0000)]
Do the period chomping right
Jeffrey Ryan Thalhammer [Thu, 30 Oct 2008 05:20:59 +0000 (05:20 +0000)]
Jeffrey Ryan Thalhammer [Wed, 29 Oct 2008 08:47:20 +0000 (08:47 +0000)]
Add another cruft file to the SKIP list
Jeffrey Ryan Thalhammer [Wed, 29 Oct 2008 08:45:01 +0000 (08:45 +0000)]
I think Schwern mention the double periods appearing at the
end of some violation descriptions and/or explanations. So
we strip out whatever punctuation the author provided, and
let the user define their own, using a format.
Jeffrey Ryan Thalhammer [Tue, 28 Oct 2008 21:32:51 +0000 (21:32 +0000)]
Offering a new Perl::Critic::Annotation class for review.
The idea here is to define an object that represents the
"## no critic" markers that appear in the file. Policies
can then interact with these objects via P::C::Document.
For example, ProhibitUnrestrictedNoCritic would look something
like this:
sub violates {
my ( $self, $doc, undef ) = @_;
# If for some reason $doc is not a P::C::Document, then all bets are off
return if not $doc->isa('Perl::Critic::Document');
my @violations = ();
for my $annotation ($doc->annotations()) {
if ($annotation->disables_all_policies()) {
my $token = $annotation->token();
push @violations, $self->violation($DESC, $EXPL, $token);
}
}
return @violations;
}
I've completed most of the work to integrate this with the existing
code. But I won't commit it until everyone has reviewed this idea.
Comments wanted!
Jeffrey Ryan Thalhammer [Mon, 27 Oct 2008 05:44:56 +0000 (05:44 +0000)]
Holy smokes, it works!
Using the --warn-about-useless-no-critic option, I found several places
where we were disabling too many policies, or were disabling them
due to bugs that have since been fixed. This is a pretty cool feature,
but I have reservations about making it into a regular Policy. Since
we use pattern-matching to select the Policies, it is really easy for
someone to disable a *future* policy. So I'm not sure I want to force
them to change their '## no critic' markers just because they've upgraded
P::C.
BTW, I discovered that we were using the wrong syntax in some of our
'## no critic' markers:
## no critic 'SomePolicy' # wrong, disables all policies.
## no critic (SomePolicy) # ok
## no critic qw(SomePolicy) # ok
We should probably emit a warning or something if we come across
a '## no critic' marker that looks wrong.
Jeffrey Ryan Thalhammer [Mon, 27 Oct 2008 05:36:14 +0000 (05:36 +0000)]
A little more tweaking. Should probably write some unit tests here.
I've become too reliant upon the functional tests.
Jeffrey Ryan Thalhammer [Mon, 27 Oct 2008 03:43:36 +0000 (03:43 +0000)]
Fixed trailing whitespace and pod spelling
Jeffrey Ryan Thalhammer [Mon, 27 Oct 2008 03:37:19 +0000 (03:37 +0000)]
Second attempt to provide warnings when a useless "## no critic"
is found. This time, I completely re-wrote the way that we
keep track of disabled lines. Instead of just marking each
line that was affected by a no-critic, I keep track of each
no-critic and the region of lines that it affects. This
makes it possible to report which no-critic markers are
not having an effect, rather than reporting all the lines
that were disabled but had no violations.
I had a hard time thinking of a good data structure
for expressing all this. So this certianly isn't the
fastest code. But this also isn't the slowest part
of Perl-Critic.
Along the way, I found that my strategy for finding
useless no-critic markers was fundamentally flawed --
the most important thing is to keep track of the
violations that were *not* reported. That way,
you can tell if a no-critic marker was effective
or not.
Elliot Shank [Mon, 27 Oct 2008 01:46:20 +0000 (01:46 +0000)]
Remove the fictional $SKIP from NamingConventions::Capitalization.
Elliot Shank [Mon, 27 Oct 2008 00:39:16 +0000 (00:39 +0000)]
Finally able to individualy commit the Perl-Critic directory itself
with the adding of nytprof to svn:ignore.
Elliot Shank [Mon, 27 Oct 2008 00:37:16 +0000 (00:37 +0000)]
Get generation of t/NamingConventions/Capitalization.run in place.
What it generates right now is static, but all the infrastructure is
in place.
Elliot Shank [Sun, 26 Oct 2008 23:50:37 +0000 (23:50 +0000)]
Remove column numbers from =over POD directives. The POD formatter
knows how things should be set, if it pays any attention to the number
at all.
Elliot Shank [Sun, 26 Oct 2008 23:41:34 +0000 (23:41 +0000)]
Create P::C::Config::all_policies_enabled_or_not() and use it in
PolicySummary.pod.PL.
Elliot Shank [Sun, 26 Oct 2008 23:37:07 +0000 (23:37 +0000)]
Add $VERSION to t/03_useless_pragmas.t and add it to the list of tests
that need to have "without optional dependencies" wrappers generated
for them.
Elliot Shank [Sun, 26 Oct 2008 21:44:28 +0000 (21:44 +0000)]
Self-compliance.
Elliot Shank [Sun, 26 Oct 2008 21:10:47 +0000 (21:10 +0000)]
Allow any number of leading underscores in names that are supposed to
start with lower|upper case letters. Finish remaining self-compliance
capitalization issues.
Elliot Shank [Sun, 26 Oct 2008 20:50:26 +0000 (20:50 +0000)]
Capitalization self-compliance in tests.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 20:45:45 +0000 (20:45 +0000)]
Explain new option in Changes file
Elliot Shank [Sun, 26 Oct 2008 20:41:40 +0000 (20:41 +0000)]
Add exemptions for $TODO and $SKIP to Capitalization.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 20:38:22 +0000 (20:38 +0000)]
Cleaned up trailing whitespace. Fixed typo in name of hash key
Elliot Shank [Sun, 26 Oct 2008 20:28:57 +0000 (20:28 +0000)]
Add nytprof to the MANIFEST.SKIP files.
Elliot Shank [Sun, 26 Oct 2008 20:21:20 +0000 (20:21 +0000)]
Don't complain about capitalization of BEGIN, UNITCHECK, etc. no
matter how things are set up on NamingConventions::Capitalization.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 20:13:00 +0000 (20:13 +0000)]
First attempt to warn users when they have an unecessary "## no critic"
marker in their code. I'm not happy with the option-name that I chose.
Also, I know there are bugs related to the shebang line, and the borders of
##no critic -> ##use critic blocks.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 18:50:37 +0000 (18:50 +0000)]
Incorporating some of Chris' suggestions.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 11:07:10 +0000 (11:07 +0000)]
Fixed more self-compliance
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 10:54:11 +0000 (10:54 +0000)]
More self compliance
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 10:04:46 +0000 (10:04 +0000)]
Get rid of that Debian-whatever file. I think it
gets produced by the Kwailitee tests.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 10:02:12 +0000 (10:02 +0000)]
Fixed up self-compliance issues in NamingConventions::Capitalization.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 09:53:23 +0000 (09:53 +0000)]
Fixed breakage that started when the names of some
of the test scripts were changed.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 09:26:16 +0000 (09:26 +0000)]
Pulled all the 'no critic' handling code out of Critic.pm
and put it into Document.pm. The internals are still kinda
ugly, but the interface is much nicer (I think).
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 09:25:02 +0000 (09:25 +0000)]
Just comment formatting changes.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 09:24:05 +0000 (09:24 +0000)]
More self-compliance.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 09:00:15 +0000 (09:00 +0000)]
Turn off Capitalization policy for now. It is making too much noise
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 08:59:40 +0000 (08:59 +0000)]
Self-compliance with ProhibitUnrestrictedNoCritic
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 07:01:26 +0000 (07:01 +0000)]
Woops, I left a naked subroutine out there.
Also re-arranged some code slightly. I do like to take advantage of
the postfix-if-with-flow-control-statements rule.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 06:52:49 +0000 (06:52 +0000)]
Vanquised can_be_disabled() method.
Jeffrey Ryan Thalhammer [Sun, 26 Oct 2008 06:36:18 +0000 (06:36 +0000)]
Resolved failing test cases for Miscellanea::ProhibitUnrestrictedNoCritic. Next, I'll remove the can_be_disabled() method.
Elliot Shank [Mon, 20 Oct 2008 05:00:43 +0000 (05:00 +0000)]
Add a check on myself: add a test that complains if any of the
optional modules aren't installed.
Elliot Shank [Sat, 18 Oct 2008 01:58:36 +0000 (01:58 +0000)]
Failing test with ProhibitParensWithBuiltins that I'm not sure what to
do with. Treat "int" as an operator?
Elliot Shank [Thu, 16 Oct 2008 02:36:31 +0000 (02:36 +0000)]
Rename the t/20_policy_*.t tests to include underscores so that the
names are notlikethis.
Elliot Shank [Thu, 16 Oct 2008 02:30:06 +0000 (02:30 +0000)]
Disable Modules::ProhibitEvilModules if there aren't any evil modules.
Elliot Shank [Thu, 16 Oct 2008 00:51:46 +0000 (00:51 +0000)]
Add subroutine name to violation descriptions for
Subroutines::ProhibitExcessComplexity. Optimistically, it handles the
case of anonymous subroutines, in case PPI ever handles them. :]
RT #40070, thanks to Andreas Koenig.
Elliot Shank [Tue, 14 Oct 2008 03:12:14 +0000 (03:12 +0000)]
Links to Test::P::C.
Elliot Shank [Tue, 14 Oct 2008 02:55:38 +0000 (02:55 +0000)]
Missed RegularExpressions::ProhibitCaptureWithoutTest in earlier bugs
documentation move commit.
Elliot Shank [Tue, 14 Oct 2008 02:53:52 +0000 (02:53 +0000)]
Add small links HTML page for holding links to *nix P::C packages and
other things.
Elliot Shank [Tue, 14 Oct 2008 01:19:23 +0000 (01:19 +0000)]
Move policy bugs from TODO.pod to the actual Policies. Users should
be aware of limitations.
Elliot Shank [Tue, 14 Oct 2008 00:48:48 +0000 (00:48 +0000)]
Delete dead code from NamingConventions::ProhibitAmbiguousNames.
Elliot Shank [Tue, 14 Oct 2008 00:40:25 +0000 (00:40 +0000)]
Code cleanups to comply with NamingConventions::Capitalization.
Amazing what some of this turned up, e.g. leftover, unused variables
from prior to conversion to use Policy Parameters.
Elliot Shank [Tue, 14 Oct 2008 00:30:32 +0000 (00:30 +0000)]
Add exceptions for the standard tie subroutines to
NamingConventions::Capitalization and borrow code from unreleased
PPI::Statement::Variable to get real variable names in the case of
"local" statements.
Elliot Shank [Tue, 14 Oct 2008 00:18:43 +0000 (00:18 +0000)]
And $P::C::Policy::FORMAT bites the dust too.
Elliot Shank [Tue, 14 Oct 2008 00:12:27 +0000 (00:12 +0000)]
$P::C::Violation::FORMAT loses to NamingConventions::Capitalization.
Oh, darn.
Elliot Shank [Mon, 13 Oct 2008 22:30:19 +0000 (22:30 +0000)]
Fix subroutine capitalization in Modules::RequireVersionVar and mark
TODO test as no longer TODO in t/Modules/RequireVersionVar.run.
Elliot Shank [Mon, 13 Oct 2008 22:17:00 +0000 (22:17 +0000)]
Add AUTOLOAD exceptions to NamingConventions::Capitalization and
include the kind of name in violation descriptions.
Elliot Shank [Mon, 13 Oct 2008 21:48:32 +0000 (21:48 +0000)]
Add explanation to RequireNoMatchVarsWithUseEnglish about merely not
importing any of the match variables not being good enough to prevent
performance problems.
Elliot Shank [Sat, 11 Oct 2008 23:44:02 +0000 (23:44 +0000)]
More fully state that development is done using Module::Build.
Chris Dolan [Sat, 11 Oct 2008 22:41:03 +0000 (22:41 +0000)]
Add some draft notes about how we do P::C releases
Elliot Shank [Sat, 11 Oct 2008 03:40:51 +0000 (03:40 +0000)]
RT #39787 is wrong. RequireNoMatchVarsWithUseEnglish is correct, as
is.
Elliot Shank [Sat, 11 Oct 2008 02:41:20 +0000 (02:41 +0000)]
Handle the __PACKAGE__->_foo() case in ProtectPrivateSubs.
Elliot Shank [Fri, 10 Oct 2008 00:35:51 +0000 (00:35 +0000)]
Add failing test for __PACKAGE__->_foo() for ProtectPrivateSubs.
Elliot Shank [Fri, 10 Oct 2008 00:33:53 +0000 (00:33 +0000)]
Add a bunch of stuff to TODO.
Elliot Shank [Mon, 6 Oct 2008 06:51:53 +0000 (06:51 +0000)]
Add a :single_case tag to NamingConventions::Capitalization and
rewrite its POD.
Chris Dolan [Sat, 4 Oct 2008 00:30:10 +0000 (00:30 +0000)]
Test for "package main" in NamingConventions::Capitalization
Elliot Shank [Fri, 3 Oct 2008 12:01:56 +0000 (12:01 +0000)]
Failing test for Modules::RequireNoMatchVarsWithUseEnglish from
RT #39787.
Elliot Shank [Fri, 3 Oct 2008 11:40:13 +0000 (11:40 +0000)]
Add "main" to the default package name exemptions to
NamingConventions::Capitalization.
Elliot Shank [Mon, 29 Sep 2008 01:02:53 +0000 (01:02 +0000)]
Simplify the regexes for the default global variables that are exempt
from Capitalization.
Elliot Shank [Mon, 29 Sep 2008 00:44:22 +0000 (00:44 +0000)]
The big NamingConventions::Capitalization rejiggering. Need to make
NamingConventions/Capitalization.run be generated. But right now, my
brain is fried.
Elliot Shank [Sun, 28 Sep 2008 22:29:12 +0000 (22:29 +0000)]
Add test for Statement::Include::module_version() in
xt/author/81_ppi_problems.t.
Elliot Shank [Sun, 28 Sep 2008 21:41:14 +0000 (21:41 +0000)]
Fix self compliance in t/05_utils_ppi.t and Utils::PPI.
Elliot Shank [Sun, 28 Sep 2008 20:54:12 +0000 (20:54 +0000)]
Add cleaned up versions of Utils::PPI::is_subroutine_declaration() and
is_in_subroutine() from Schwern.
Elliot Shank [Sun, 28 Sep 2008 20:06:28 +0000 (20:06 +0000)]
Add a test file for things we want from PPI.
Chris Dolan [Sun, 28 Sep 2008 15:07:45 +0000 (15:07 +0000)]
Rename Variables::ProhibitReusedVarNames to Variables::ProhibitReusedNames
Elliot Shank [Sun, 28 Sep 2008 14:15:22 +0000 (14:15 +0000)]
Update threading comment in TODO.pod.
Elliot Shank [Sun, 28 Sep 2008 14:13:38 +0000 (14:13 +0000)]
Add threading idea to TODO.pod.