Here's a patch:
Index: Perl-Critic/t/TestingAndDebugging/RequireUseStrict.run
===================================================================
--- Perl-Critic/t/TestingAndDebugging/RequireUseStrict.run (revision 3148)
+++ Perl-Critic/t/TestingAndDebugging/RequireUseStrict.run (working copy)
@@ -154,6 +154,15 @@
#-----------------------------------------------------------------------------
+## name Modern::Perl support
+## failures 0
+## cut
+
+use Modern::Perl;
+$foo = $bar;
+
+#-----------------------------------------------------------------------------
+
## name equivalent_modules
## failures 0
## parms { equivalent_modules => 'Foo' }
Index: Perl-Critic/t/TestingAndDebugging/RequireUseWarnings.run
===================================================================
--- Perl-Critic/t/TestingAndDebugging/RequireUseWarnings.run (revision 3148)
+++ Perl-Critic/t/TestingAndDebugging/RequireUseWarnings.run (working copy)
@@ -188,6 +188,15 @@
#-----------------------------------------------------------------------------
+## name Modern::Perl support
+## failures 0
+## cut
+
+use Modern::Perl;
+$foo = $bar;
+
+#-----------------------------------------------------------------------------
+
## name equivalent_modules
## failures 0
## parms { equivalent_modules => 'Foo' }
Index:
Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm
===================================================================
---
Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm
(revision 3148)
+++
Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm
(working copy)
@@ -33,7 +33,7 @@
default_string => $EMPTY,
behavior => 'string list',
list_always_present_values =>
- [ qw< strict Moose Moose::Role
Moose::Util::TypeConstraints > ],
+ [ qw< strict Moose Moose::Role
Moose::Util::TypeConstraints Modern::Perl > ],
},
);
}
@@ -134,10 +134,10 @@
code in the entire package will be affected.
There are special exemptions for L<Moose|Moose>,
-L<Moose::Role|Moose::Role>, and
-L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints> because
-they enforces strictness; e.g. C<'use Moose'> is treated as
-equivalent to C<'use strict'>.
+L<Moose::Role|Moose::Role>,
+L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints>,
+and L<Modern::Perl|Modern::Perl> because they enforce strictness;
+e.g. C<'use Moose'> is treated as equivalent to C<'use strict'>.
The maximum number of violations per document for this policy defaults
to 1.
Index:
Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseWarnings.pm
===================================================================
---
Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseWarnings.pm
(revision 3148)
+++
Perl-Critic/lib/Perl/Critic/Policy/TestingAndDebugging/RequireUseWarnings.pm
(working copy)
@@ -38,7 +38,7 @@
default_string => $EMPTY,
behavior => 'string list',
list_always_present_values =>
- [ qw< warnings Moose Moose::Role
Moose::Util::TypeConstraints > ],
+ [ qw< warnings Moose Moose::Role
Moose::Util::TypeConstraints Modern::Perl > ],
},
);
}
@@ -142,11 +142,10 @@
statements. Thus, all the code in the entire package will be
affected.
-There are special exemptions for L<Moose|Moose>,
-L<Moose::Role|Moose::Role>, and
-L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints> because
-they enforces warnings; e.g. C<'use Moose'> is treated as
-equivalent to C<'use warnings'>.
+There are special exemptions for L<Moose|Moose>,
L<Moose::Role|Moose::Role>,
+L<Moose::Util::TypeConstraints|Moose::Util::TypeConstraints>, and
+L<Modern::Perl|Modern::Perl> because they enforce warnings; e.g.
+C<'use Moose'> is treated as equivalent to C<'use warnings'>.
This policy will not complain if the file explicitly states that it is
compatible with a version of perl prior to 5.6 via an include