From: Simon Ruderich Date: Sun, 16 Sep 2012 20:28:38 +0000 (+0200) Subject: perl/perlcriticrc: Add, perlcriticrc configuration file. X-Git-Url: https://ruderich.org/simon/gitweb/?p=config%2Fdotfiles.git;a=commitdiff_plain;h=35b924d46fd7056f0ec62b1669b1d8c0b57da3f6 perl/perlcriticrc: Add, perlcriticrc configuration file. --- diff --git a/perl/perlcriticrc b/perl/perlcriticrc new file mode 100644 index 0000000..476ae8a --- /dev/null +++ b/perl/perlcriticrc @@ -0,0 +1,55 @@ +# 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] + +# 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 = $! $. $@ $/ $" + +# Allow the usage of ".." when '..' occurs inside the string, e.g. in strings +# like ".. '..' ..". +[ValuesAndExpressions::ProhibitInterpolationOfLiterals] +allow_if_string_contains_single_quote = 1 diff --git a/setup.sh b/setup.sh index 6004b6c..0f26329 100755 --- a/setup.sh +++ b/setup.sh @@ -25,3 +25,6 @@ link gdbinit ~/.gdbinit # Maxima, a symbolic algebra program. link maxima ~/.maxima + +# perlcritic to check Perl programs for common problems. +link perl/perlcriticrc ~/.perlcriticrc