]> git.donarmstrong.com Git - perltidy.git/commitdiff
Activate PC policy Subroutines::ProhibitBuiltinHomonyms
authorSteve Hancock <perltidy@users.sourceforge.net>
Tue, 29 Aug 2023 22:07:34 +0000 (15:07 -0700)
committerSteve Hancock <perltidy@users.sourceforge.net>
Tue, 29 Aug 2023 22:07:34 +0000 (15:07 -0700)
.perlcriticrc
lib/Perl/Tidy/IOScalar.pm
lib/Perl/Tidy/IOScalarArray.pm

index 89b4e900eb3e460827c29fc1c6662ebf2b2d7565..a96aa5c0a9e6db52a163fb46b7c145b60e8c3c4f 100644 (file)
@@ -15,8 +15,7 @@
 # rigid rules.
 
 # I have found the '## no critic' method for locally deactivating specific
-# policies with comments to be too troublesome to use. So unfortunately
-# policies are either on or off.
+# policies with comments to be very troublesome to use.
 
 # severity = 1 gives the most strict checking.
 severity = 1
@@ -30,10 +29,8 @@ verbose = %f: [%p] %m at line %l, column %c.\n
 # Tidy.pm exports 'perltidy'. Changing this could break existing scripts.
 [-Modules::ProhibitAutomaticExportation]
 
-# IOScalar and IOScalarArray need to define a 'print' function
-[-Subroutines::ProhibitBuiltinHomonyms]
-
-# Nested subs are currently needed for error handling in Tidy.pm.
+# Nested subs are currently needed for error handling in Tidy.pm. I'm not
+# sure if this can be avoided.
 [-Subroutines::ProhibitNestedSubs]
 
 # Make adjustment so that we don't require arg unpacking for very short
@@ -52,7 +49,7 @@ short_subroutine_statements = 2
 # my editor uses color to make it clear if interpolation is in effect.
 [-ValuesAndExpressions::RequireQuotedHeredocTerminator]
 
-# Perlcritic doesn't seem to know that @ARGV in Perl::Tidy actually **is**
+# Perlcritic doesn't seem to see that @ARGV in Perl::Tidy actually **is**
 # localized.  Localization of @ARGV could be avoided by calling
 # GetOptionsFromArray instead of GetOptions, but that is not available before
 # perl 5.10, and we want to continue supporting Perl 5.8. So we have to skip
@@ -69,8 +66,8 @@ lines=30
 # Following is a list of policies to be skipped for severity=3:
 #--------------------------------------------------------------
 
-# AUTOLOAD is used in perltidy to help find and debug programming errors.
-# This is very useful, so we have to skip this.
+# AUTOLOAD is used in perltidy to help find and debug programming errors rather
+# than doing autoloading.  This is very useful, so we have to skip this.
 [-ClassHierarchies::ProhibitAutoloading]
 
 # This policy is very useful in locating complex code which might benefit from
@@ -189,8 +186,8 @@ max_nests=9
 # As the documentation says, this policy is not for everyone
 [-RegularExpressions::ProhibitEnumeratedClasses]
 
-# Disagree. Double quotes are easier to read than single quotes and allow a
-# uniform style for quotes.  My editor has color coding which indicates
+# Completely Disagree. Double quotes are easier to read than single quotes and
+# allow a uniform style for quotes.  My editor has color coding which indicates
 # interpolation. Double quotes do not increase processing time by any
 # measurable amount.  Using them as default simplfies making editing changes.
 # So skip this:
index 434c366dc26ed91cd04681c454a6703bcb44f2b8..07ede06f3847a2499e612c192fcdc656fefdcead 100644 (file)
@@ -102,7 +102,8 @@ EOM
     return $self->[0]->[$i];
 }
 
-sub print {
+sub print    ## no critic (Subroutines::ProhibitBuiltinHomonyms)
+{
     my ( $self, $msg ) = @_;
     my $mode = $self->[1];
     if ( $mode ne 'w' ) {
index af262f4e0aeee19248ce755afe8dd2e6faf5fd2e..1f5a35facc10bf018ac9a09f9825503225af873c 100644 (file)
@@ -90,7 +90,8 @@ EOM
     return $self->[0]->[$i];
 }
 
-sub print {
+sub print    ## no critic (Subroutines::ProhibitBuiltinHomonyms)
+{
     my ( $self, $msg ) = @_;
     my $mode = $self->[1];
     if ( $mode ne 'w' ) {