Perl-Critic / PPI

53 stars 44 forks source link

#246 CHECK bareword handle parsed as scheduled block #247

Closed trwyant closed 2 years ago

trwyant commented 4 years ago

The fix ensures that a the keyword for a prospective scheduled block is followed by '{' or ';'. Otherwise it is not parsed as a scheduled block.

I have run both modified and unmodified PPI against all of CPAN, looking for instances of PPI::Statement::Scheduled where the keyword is not followed by a block. All the differences were either irrelevant (stuff like temporary directory names, or non-Perl (i.e. filters)), or statements like open( CHECK, ... ) which disappeared when the new code was used.

trwyant commented 4 years ago

Any chance of this being accepted? Or rejected? I submitted it back in February, and then completely forgot about it until I got my cage rattled on the original Perl::Critic issue, to wit [https://github.com/Perl-Critic/Perl-Critic/issues/878].

wchristian commented 4 years ago

Sorry, i'll try and have a look tomorrow. :)

trwyant commented 4 years ago

Nudge?

oalders commented 2 years ago

Closing and re-opening to trigger CI.

wchristian commented 2 years ago

This looks ok if the tests pass after rebasing.

The stray newline can probably go?

There should be an additional ticket to verify that this stuff behaves well for all of these: https://perldoc.perl.org/perlmod#BEGIN,-UNITCHECK,-CHECK,-INIT-and-END

oalders commented 2 years ago

I have a rebased branch and will merge at the command line if the checks pass.

oalders commented 2 years ago

Merged via 52004df2da6d3b47046. Thanks, @trwyant!