X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=blobdiff_plain;f=misc%2Fperl%2Fperlcriticrc;fp=misc%2Fperl%2Fperlcriticrc;h=6fb1f062c9fdd8f0f5ec1f168c0848e75782b949;hp=0000000000000000000000000000000000000000;hb=8ccb9052dca010073caa5df18c71e6c2a7200fcc;hpb=54e498cc877f4e05b5788b0a886ee02546f41a47 diff --git a/misc/perl/perlcriticrc b/misc/perl/perlcriticrc new file mode 100644 index 0000000..6fb1f06 --- /dev/null +++ b/misc/perl/perlcriticrc @@ -0,0 +1,62 @@ +# perlcritic configuration file + +# Copyright (C) 2012 Simon Ruderich +# +# This file is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this file. If not, see . + + +# Be strict about errors in ~/.perlcriticrc. +profile-strictness = fatal + +# Display all errors/warnings by default. +severity = brutal + +# Use colored output. +color = 1 + + +# IMHO 'x' is more readable than q{x}, so ignore this warning. +[-ValuesAndExpressions::ProhibitNoisyQuotes] +# Same for '', ignore it too. +[-ValuesAndExpressions::ProhibitEmptyQuotes] + +# I know how /s, /x and /m work (and expect that from others), ignore these +# warnings. +[-RegularExpressions::RequireDotMatchAnything] +[-RegularExpressions::RequireExtendedFormatting] +[-RegularExpressions::RequireLineBoundaryMatching] + +# I prefer exact line numbers in errors, allow die instead of croak. I don't +# develop perl modules so it shouldn't be a problem. +[-ErrorHandling::RequireCarping] + +# IMHO "print $FH ..." is readable enough, "print {$FH} ..." is not necessary. +[-InputOutput::RequireBracedFileHandleWithPrint] + +# Don't require checks for print's return value. I check the return value of +# other functions like open() or close(), but checking every print is just a +# waste of time. +[InputOutput::RequireCheckedSyscalls] +functions = :builtins +exclude_functions = print + +# IMHO punctuation variables are more readable than their English counterparts +# (and faster in some cases). So allow the ones I use often. +[Variables::ProhibitPunctuationVars] +allow = $0 $! $? $. $@ $/ $" $+ $- + +# Allow the usage of ".." when '..' occurs inside the string, e.g. in strings +# like ".. '..' ..". +[ValuesAndExpressions::ProhibitInterpolationOfLiterals] +allow_if_string_contains_single_quote = 1