Fix perltidy breaking perlcritic
authorAlvaro Herrera <[email protected]>
Thu, 8 Sep 2022 09:16:09 +0000 (11:16 +0200)
committerAlvaro Herrera <[email protected]>
Thu, 8 Sep 2022 09:20:29 +0000 (11:20 +0200)
perltidying a "##no critic" line moves the marker to where it becomes
useless.  Put the line back to how it was, and protect it from further
malfeasance.

Per buildfarm member crake.

src/backend/catalog/Catalog.pm

index 4a9fa3b2cbdefb148b0134af54a4c9088ade3c3b..1546e1b33508f7cfb0b6fe3d57fab1cc21701ba5 100644 (file)
@@ -315,8 +315,10 @@ sub ParseData
                                        # 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)
+                                       #<<< protect next line from perltidy
+                                       # so perlcritic annotation works
+                                       eval '$hash_ref = ' . $_;    ## no critic (ProhibitStringyEval)
+                                       #>>>
                                        if (!ref $hash_ref)
                                        {
                                                die "$input_file: error parsing line $.:\n$_\n";