Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d2c1512

Browse files
committed
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.
1 parent 17551f1 commit d2c1512

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/backend/catalog/Catalog.pm

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,10 @@ sub ParseData
250250

251251
if ($lcnt == $rcnt)
252252
{
253-
eval '$hash_ref = ' . $_;
253+
# We're treating the input line as a piece of Perl, so we
254+
# need to use string eval here. Tell perlcritic we know what
255+
# we're doing.
256+
eval '$hash_ref = ' . $_; ## no critic (ProhibitStringyEval)
254257
if (!ref $hash_ref)
255258
{
256259
die "$input_file: error parsing line $.:\n$_\n";

src/backend/utils/Gen_dummy_probes.pl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#
1515
#-------------------------------------------------------------------------
1616

17+
# turn off perlcritic for autogened code
18+
## no critic
19+
1720
$0 =~ s/^.*?(\w+)[\.\w+]*$/$1/;
1821

1922
use strict;

src/pl/plperl/plc_perlboot.pl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ sub ::encode_array_constructor
5151
}
5252

5353
{
54-
55-
package PostgreSQL::InServer
56-
; ## no critic (RequireFilenameMatchesPackage);
54+
#<<< protect next line from perltidy so perlcritic annotation works
55+
package PostgreSQL::InServer; ## no critic (RequireFilenameMatchesPackage)
56+
#>>>
5757
use strict;
5858
use warnings;
5959

src/pl/plperl/plc_trusted.pl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# src/pl/plperl/plc_trusted.pl
22

3-
package PostgreSQL::InServer::safe
4-
; ## no critic (RequireFilenameMatchesPackage);
3+
#<<< protect next line from perltidy so perlcritic annotation works
4+
package PostgreSQL::InServer::safe; ## no critic (RequireFilenameMatchesPackage)
5+
#>>>
56

67
# Load widely useful pragmas into plperl to make them available.
78
#

0 commit comments

Comments
 (0)