]> git.donarmstrong.com Git - perltidy.git/commitdiff
update comments
authorSteve Hancock <perltidy@users.sourceforge.net>
Mon, 11 Jul 2022 01:14:18 +0000 (18:14 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Mon, 11 Jul 2022 01:14:18 +0000 (18:14 -0700)
.perlcriticrc
dev-bin/perltidy_random_setup.pl

index cf2d22f569126c0cb9f95916da80c1157b7d5e58..2ef70d961df613c108e7badd5be8d6f4038c3439 100644 (file)
@@ -13,10 +13,11 @@ verbose = %f: [%p] %m at line %l, column %c.\n
 
 # Below is a list of policies that are skipped or customized to the needs of
 # Perl::Tidy.  I have found that using 'no critic' comments is very
-# troublesome*, so policies are either 'on' or 'off' for all modules.
-# ( *For example, why is it necessary to specify a policy in a side comment?
-# The very long policy names are ugly and typically make the side comment
-# exceed the desired line length. )
+# troublesome*, so policies are either 'on' or 'off' for all modules.  ( *For
+# example, it is necessary to specify a policy even in a side comment, which
+# seems needless.  The very long policy names make the line hard to read, and
+# so long that side comment will usually exceed the desired line length,
+# leading to more trouble if that causes a new line break.
 
 #--------------------------------------------------------------
 # Following is a list of policies to be skipped for severity=4:
@@ -57,10 +58,15 @@ verbose = %f: [%p] %m at line %l, column %c.\n
 # my editor uses color to make it clear if interpolation is in effect.
 [-ValuesAndExpressions::RequireQuotedHeredocTerminator]
 
-# Perlcritic doesn't know ARGV actually is localized (it would be hard
-# to program it to determine this).
+# Perlcritic doesn't know ARGV actually is localized
 [-Variables::RequireLocalizedPunctuationVars]
 
+# Unfortunately the perlcritic coding for this policy is buggy when lines=n is
+# specified.  For example if I use lines=n to increase 'n' above the default of
+# 9, then suddenly I get error messages for code which previously passed with
+# the default. So we have to skip this.
+[-InputOutput::RequireBriefOpen]
+
 #--------------------------------------------------------------
 # Following is a list of policies to be skipped for severity=3:
 #--------------------------------------------------------------
@@ -70,8 +76,10 @@ verbose = %f: [%p] %m at line %l, column %c.\n
 [-ClassHierarchies::ProhibitAutoloading]
 
 # The max values below can be reduced to locate code which might be simplified.
+# There are a couple of complex routines in Formatter.pm which reach a mccabe
+# of 150 and cannot be simplified without significantly slowing down perltidy.
 [Subroutines::ProhibitExcessComplexity]
-max_mccabe=153
+max_mccabe=150
 [ControlStructures::ProhibitDeepNests]
 max_nests=7
 
@@ -126,6 +134,10 @@ max_nests=7
 [-ControlStructures::ProhibitPostfixControls]
 
 # Sometimes an unless block is clearer than an if block
+# For example, I prefer the first of these:
+#  return unless ($everything_is_ok);
+# vs.
+#  return if (!$everything_is_ok);
 [-ControlStructures::ProhibitUnlessBlocks]
 
 # The very few instances of boolean grep are fine. Profiling shows that
@@ -147,7 +159,7 @@ max_nests=7
 #--------------------------------------------------------------
 
 # This is a good starting rule, but occasional capitalization can be quite
-# effective, so we have to ignore it as a general rule:
+# effective or appropriate, so we have to ignore it as a general rule:
 [-NamingConventions::Capitalization]
 
 # It would be nice if this option were configurable to skip STDERR and STDOUT
index bfba56b8c17385d0a09ea688b9cc61b40ba86de5..be7509dfd8d5e7a45358ee8374c4a1a1cb8b4b9b 100755 (executable)
@@ -1221,6 +1221,7 @@ EOM
           assert-untidy
           backup-and-modify-in-place
           backup-file-extension
+          backup-method
           character-encoding
           dump-cuddled-block-list
           dump-defaults