Skip to content
Browse files

Recreating changes from 1.07_01 to 1.08 from CPAN tarball

  • Loading branch information...
1 parent c5768b9 commit 168d796f9f947c44d876eced9bb5f482c0b9430a @petdance committed Aug 20, 2012
View
13 Changes
@@ -1,5 +1,18 @@
Revision history for Perl-Critic-Bangs
+1.08 Mon Jun 20 11:56:49 CDT 2011
+====================================
+Official release, no changes from 1.07_02
+
+
+1.07_02 Tue May 17 11:06:41 CDT 2011
+====================================
+[ENHANCEMENTS]
+The list of bitwise operators prohibited is now:
+
+ & | ^ ~ &= |= ^=
+
+
1.07_01 Mon May 16 23:48:20 CDT 2011
====================================
As of 1.07_01, Perl::Critic::Bangs is released under Artistic License 2.0,
View
1 MANIFEST
@@ -38,3 +38,4 @@ t/tlib/Perl/Critic/Policy/Test.pm
t/tlib/Perl/Critic/TestUtilitiesWithMinimalDependencies.pm
t/tlib/ViolationTest.pm
t/tlib/ViolationTest2.pm
+META.yml Module meta-data (added by MakeMaker)
View
6 lib/Perl/Critic/Bangs.pm
@@ -11,11 +11,11 @@ Perl::Critic::Bangs - A collection of handy Perl::Critic policies
=head1 VERSION
-Version 1.07_01
+Version 1.08
=cut
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
=head1 SYNOPSIS
@@ -128,7 +128,7 @@ Thanks to
=back
-=head1 COPYRIGHT & LICENSE
+=head1 COPYRIGHT
Copyright 2006-2011 Andy Lester.
View
6 lib/Perl/Critic/Policy/Bangs/ProhibitBitwiseOperators.pm
@@ -8,7 +8,7 @@ use Readonly;
use Perl::Critic::Utils qw{ :severities :classification :data_conversion };
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
#-----------------------------------------------------------------------------
@@ -19,12 +19,12 @@ Readonly::Scalar my $EXPL => q{Use of bitwise operator};
sub supported_parameters { return () }
sub default_severity { return $SEVERITY_HIGHEST }
-sub default_themes { return qw( bangs bugs ) }
+sub default_themes { return qw( core bugs ) }
sub applies_to { return 'PPI::Token::Operator' }
#-----------------------------------------------------------------------------
-my %bitwise_operators = hashify( qw( & | ^ ~ ) );
+my %bitwise_operators = hashify( qw( & | ^ ~ &= |= ^= ) );
sub violates {
my ( $self, $elem, undef ) = @_;
View
2 lib/Perl/Critic/Policy/Bangs/ProhibitCommentedOutCode.pm
@@ -5,7 +5,7 @@ use warnings;
use Perl::Critic::Utils;
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
#---------------------------------------------------------------------------
View
2 lib/Perl/Critic/Policy/Bangs/ProhibitFlagComments.pm
@@ -5,7 +5,7 @@ use warnings;
use Perl::Critic::Utils;
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
#----------------------------------------------------------------------------
View
2 lib/Perl/Critic/Policy/Bangs/ProhibitNoPlan.pm
@@ -5,7 +5,7 @@ use warnings;
use Perl::Critic::Utils;
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
sub supported_parameters { return () }
sub default_severity { return $SEVERITY_LOW }
View
2 lib/Perl/Critic/Policy/Bangs/ProhibitNumberedNames.pm
@@ -5,7 +5,7 @@ use warnings;
use Perl::Critic::Utils;
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
sub supported_parameters {
return (
View
2 lib/Perl/Critic/Policy/Bangs/ProhibitRefProtoOrProto.pm
@@ -5,7 +5,7 @@ use warnings;
use Perl::Critic::Utils;
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
sub supported_parameters { return () }
sub default_severity { return $SEVERITY_HIGH }
View
2 lib/Perl/Critic/Policy/Bangs/ProhibitUselessRegexModifiers.pm
@@ -7,7 +7,7 @@ use Readonly;
use Perl::Critic::Utils qw{ :severities :classification :ppi };
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
Readonly::Scalar my $DESC => q{Prohibits adding "m" modifier to compiled regular expressions where it does nothing};
Readonly::Scalar my $EXPL => <<'EOF';
View
2 lib/Perl/Critic/Policy/Bangs/ProhibitVagueNames.pm
@@ -5,7 +5,7 @@ use warnings;
use Perl::Critic::Utils qw( :booleans :severities );
use base 'Perl::Critic::Policy';
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
#----------------------------------------------------------------------------
View
2 t/00_modules.t
@@ -9,7 +9,7 @@ use English qw(-no_match_vars);
#-----------------------------------------------------------------------------
-our $VERSION = '1.07_01';
+our $VERSION = '1.08';
#-----------------------------------------------------------------------------
View
2 t/20_policies.t
@@ -98,7 +98,7 @@ for my $policy ( sort keys %{$subtests} ) {
if ($subtest->{optional_modules}) {
MODULE:
for my $module (split m/,\s*/xms, $subtest->{optional_modules}) {
- eval "require $module";
+ eval "require $module"; ## no critic (ProhibitStringyEval)
if ($EVAL_ERROR) {
$expected_failures = 0;
last MODULE;
View
6 t/40_criticize.t
@@ -12,11 +12,11 @@ use English qw( -no_match_vars );
use File::Spec qw();
use Perl::Critic::PolicyFactory;
-use Perl::Critic::Utils qw{ :characters };
-use Perl::Critic::TestUtilitiesWithMinimalDependencies qw{
+use Perl::Critic::Utils qw( :characters );
+use Perl::Critic::TestUtilitiesWithMinimalDependencies qw(
should_skip_author_tests
get_author_test_skip_message
-};
+);
use Test::More;
View
4 t/40_perlcriticrc
@@ -19,8 +19,7 @@ allow_leading_tabs = 0
[-CodeLayout::ProhibitParensWithBuiltins]
-[Documentation::PodSpelling]
-stop_words = autoflushes BBEdit CGI CPAN CVS Dolan exponentials filename Guzis HEREDOC HEREDOCs IDE Maxia Mehner multi-line namespace namespaces PBP perl perlcritic perlcriticrc PolicyListing postfix programmatically PPI Readonly refactor refactoring runtime sigil sigils SQL STDERR STDIN STDOUT subdirectories TerMarsch Thalhammer TODO UI unblessed vice-versa
+[-Documentation::PodSpelling]
[-Documentation::RequirePodAtEnd]
@@ -39,6 +38,7 @@ allow_all_brackets = 1
[RegularExpressions::RequireBracesForMultiline]
allow_all_brackets = 1
+[-RegularExpressions::RequireDotMatchAnything]
[-RegularExpressions::RequireExtendedFormatting]
[-RegularExpressions::RequireLineBoundaryMatching]
View
122 t/Bangs/ProhibitBitwiseOperators.run
@@ -1,17 +1,125 @@
-## name Double ops are OK
+## name Non-bitwise ops are OK
## failures 0
## cut
-my $a;
-my $b;
-my $c = $a || $b;
+$a->{foo};
+$a++;
+++$a;
+$a--;
+--$a;
+$a ** $b;
+$a =~ m/./;
+$a !~ m/./;
+$a * $b;
+$a / $b;
+$a % $b;
+$a x $b;
+$a + $b;
+$a - $b;
+$a . $b;
+$a > $b;
+$a < $b;
+$a <= $b;
+$a >= $b;
+$a lt $b;
+$a gt $b;
+$a le $b;
+$a ge $b;
+$a == $b;
+$a != $b;
+$a <=> $b;
+$a eq $b;
+$a ne $b;
+$a cmp $b;
+$a ~~ $b;
+$a && $b;
+$a || $b;
+$a // $b;
+$a .. $b;
+$a ... $b;
+$a ? 1 : 2;
+$a = $b;
+$a **= $b;
+$a += $b;
+$a -= $b;
+$a .= $b;
+$a *= $b;
+$a /= $b;
+$a %= $b;
+$a x= $b;
+$a &&= $b;
+$a ||= $b;
+$a //= $b;
+$a, $b;
+$a = { foo => 'bar' };
+$a not $b;
+$a and $b;
+$a or $b;
+$a xor $b;
#-----------------------------------------------------------------------------
## name Bitwise OR failure
## failures 1
## cut
-my $a;
-my $b;
-my $c = $a | $b;
+$c = $a | $b;
+
+#-----------------------------------------------------------------------------
+
+## name Bitwise AND failure
+## failures 1
+## cut
+
+$c = $a & $b;
+
+#-----------------------------------------------------------------------------
+
+## name Bitwise XOR failure
+## failures 1
+## cut
+
+$c = ^$b;
+
+#-----------------------------------------------------------------------------
+
+## name Bitwise NEGATE failure
+## failures 1
+## cut
+
+$c = ^$b;
+
+#-----------------------------------------------------------------------------
+
+## name Bitwise AUGUMENTED ASSIGNMENT OR failure
+## failures 1
+## cut
+
+$c |= $b;
+
+#-----------------------------------------------------------------------------
+
+## name Bitwise AUGUMENTED ASSIGNMENT AND failure
+## failures 1
+## cut
+
+$c &= 1;
+
+#-----------------------------------------------------------------------------
+
+## name Bitwise AUGUMENTED ASSIGNMENT XOR failure
+## failures 1
+## cut
+
+$c ^= $b;
+
+#-----------------------------------------------------------------------------
+## name All other bitwise ops are OK
+## failures 0
+## cut
+
+$a << 1;
+$a >> 1;
+$a <<= 1;
+$a >>= 1;
+

0 comments on commit 168d796

Please sign in to comment.
Something went wrong with that request. Please try again.