diff options
author | Andrew Dunstan <andrew@dunslane.net> | 2018-05-07 15:21:00 -0400 |
---|---|---|
committer | Andrew Dunstan <andrew@dunslane.net> | 2018-05-07 15:35:32 -0400 |
commit | d2c1512ac48c1c25dfec07d341e9b74e57f6fbc4 (patch) | |
tree | 934533e73b01864633fcfa2e4c0eb80bce63026e /src/backend | |
parent | 17551f1a21fa8e70aa0bca1153de03460742565c (diff) |
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.
Diffstat (limited to 'src/backend')
-rw-r--r-- | src/backend/catalog/Catalog.pm | 5 | ||||
-rw-r--r-- | src/backend/utils/Gen_dummy_probes.pl | 3 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm index 7497d9cd9fb..f387c865c68 100644 --- a/src/backend/catalog/Catalog.pm +++ b/src/backend/catalog/Catalog.pm @@ -250,7 +250,10 @@ sub ParseData 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) { die "$input_file: error parsing line $.:\n$_\n"; diff --git a/src/backend/utils/Gen_dummy_probes.pl b/src/backend/utils/Gen_dummy_probes.pl index a38fea3e043..91d79684e99 100644 --- a/src/backend/utils/Gen_dummy_probes.pl +++ b/src/backend/utils/Gen_dummy_probes.pl @@ -14,6 +14,9 @@ # #------------------------------------------------------------------------- +# turn off perlcritic for autogened code +## no critic + $0 =~ s/^.*?(\w+)[\.\w+]*$/$1/; use strict; |