Closed trwyant closed 2 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].
Sorry, i'll try and have a look tomorrow. :)
Nudge?
Closing and re-opening to trigger CI.
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
I have a rebased branch and will merge at the command line if the checks pass.
Merged via 52004df2da6d3b47046. Thanks, @trwyant!
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.