Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

My best parctice for perlcritic

  • Loading branch information...
commit 30a431ade112ac2f2a0078a5520825aa6c989270 1 parent 9966587
@tokuhirom authored
Showing with 46 additions and 11 deletions.
  1. +46 −11 xt/02_perlcritic.t
View
57 xt/02_perlcritic.t
@@ -1,14 +1,49 @@
use strict;
+use warnings;
use Test::More;
-eval q{
- use Test::Perl::Critic 1.02 -exclude => [
- 'Subroutines::ProhibitSubroutinePrototypes',
- 'Subroutines::ProhibitExplicitReturnUndef',
- 'TestingAndDebugging::ProhibitNoStrict',
- 'ControlStructures::ProhibitMutatingListFunctions',
- 'InputOutput::ProhibitInteractiveTest',
- 'BuiltinFunctions::ProhibitStringyEval',
- ]
+
+eval {
+ require Perl::Critic;
+ Perl::Critic->VERSION(1.105);
+
+ require Test::Perl::Critic;
+ Test::Perl::Critic->VERSION(1.02);
+ Test::Perl::Critic->import(
+ -profile => \(join q{}, <DATA>)
+ );
};
-plan skip_all => "Test::Perl::Critic 1.02+ is not installed." if $@;
-all_critic_ok('lib');
+note $@ if $@;
+plan skip_all => "Perl::Critic 1.105+ or Test::Perl::Critic 1.02+ is not installed." if $@;
+
+all_critic_ok('lib', 'script', 'bin');
+
+__END__
+
+only=1
+
+# -------------------------------------------------------------------------
+# Not important.
+
+[BuiltinFunctions::ProhibitSleepViaSelect]
+[BuiltinFunctions::RequireGlobFunction]
+[ClassHierarchies::ProhibitOneArgBless]
+
+# -------------------------------------------------------------------------
+# Bug detection
+[InputOutput::ProhibitBarewordFileHandles]
+[Modules::RequireFilenameMatchesPackage]
+[Subroutines::ProhibitNestedSubs]
+[Subroutines::ProhibitReturnSort]
+[TestingAndDebugging::RequireUseStrict]
+[Variables::ProhibitConditionalDeclarations]
+[Variables::RequireLexicalLoopIterators]
+
+[TestingAndDebugging::ProhibitNoStrict]
+allow=refs
+
+# -------------------------------------------------------------------------
+# Security issue detection
+[InputOutput::RequireEncodingWithUTF8Layer]
+[Modules::ProhibitEvilModules]
+[InputOutput::ProhibitTwoArgOpen]
+
Please sign in to comment.
Something went wrong with that request. Please try again.