Permalink
Browse files

better perlcriticrc

  • Loading branch information...
1 parent 6a8df53 commit 2fa0776f996293da537ca28a50cc404eeaecc3f1 @tokuhirom committed Apr 24, 2013
Showing with 46 additions and 10 deletions.
  1. +46 −10 xt/02_perlcritic.t
View
56 xt/02_perlcritic.t
@@ -1,13 +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',
- ]
+
+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]
+

0 comments on commit 2fa0776

Please sign in to comment.