Commit d2c1512a authored by Andrew Dunstan's avatar Andrew Dunstan

Clean up some perlcritic warnings

In Catalog.pm, mark eval of a string instead of a block as allowed.
Disallow perlcritic completely in Gen_dummy_probes.pl, as it's
generated code.
Protect a couple of lines in plperl code from  perltidy, so that the
annotation for perlcritic stays on the same line as the construct it
would otherwise object to.
parent 17551f1a
...@@ -250,7 +250,10 @@ sub ParseData ...@@ -250,7 +250,10 @@ sub ParseData
if ($lcnt == $rcnt) if ($lcnt == $rcnt)
{ {
eval '$hash_ref = ' . $_; # We're treating the input line as a piece of Perl, so we
# need to use string eval here. Tell perlcritic we know what
# we're doing.
eval '$hash_ref = ' . $_; ## no critic (ProhibitStringyEval)
if (!ref $hash_ref) if (!ref $hash_ref)
{ {
die "$input_file: error parsing line $.:\n$_\n"; die "$input_file: error parsing line $.:\n$_\n";
......
...@@ -14,6 +14,9 @@ ...@@ -14,6 +14,9 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# turn off perlcritic for autogened code
## no critic
$0 =~ s/^.*?(\w+)[\.\w+]*$/$1/; $0 =~ s/^.*?(\w+)[\.\w+]*$/$1/;
use strict; use strict;
......
...@@ -51,9 +51,9 @@ sub ::encode_array_constructor ...@@ -51,9 +51,9 @@ sub ::encode_array_constructor
} }
{ {
#<<< protect next line from perltidy so perlcritic annotation works
package PostgreSQL::InServer package PostgreSQL::InServer; ## no critic (RequireFilenameMatchesPackage)
; ## no critic (RequireFilenameMatchesPackage); #>>>
use strict; use strict;
use warnings; use warnings;
......
# src/pl/plperl/plc_trusted.pl # src/pl/plperl/plc_trusted.pl
package PostgreSQL::InServer::safe #<<< protect next line from perltidy so perlcritic annotation works
; ## no critic (RequireFilenameMatchesPackage); package PostgreSQL::InServer::safe; ## no critic (RequireFilenameMatchesPackage)
#>>>
# Load widely useful pragmas into plperl to make them available. # Load widely useful pragmas into plperl to make them available.
# #
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment