Subject: | Catch exceptions coming out of PPI and skip those files |
Running PPI over it's own source code, perlcritic barfs.
The problem is with a specific check in 14_charsets.t to detect if PPI
is going to be able to handle parsing unicode (because in non-unicode
locales, PPI can't parse Unicode...).
Of course, when PPI tries to parse this expression (that checks to see
if it can parse the expression), it fails :)
So it is somehow going to be necesary to catch exceptions coming out of
PPI and skipping that file (at the very least on platforms that can't
handle unicode).
Adam K
-----------------------------------------------------
C:\devel\cpan\trunk\PPI>perlcritic .
.\Makefile.PL source OK
.\inline2test.tpl source OK
lib\PPI.pm source OK
t\01_compile.t source OK
t\02_api.t source OK
t\03_empiric.t source OK
t\04_element.t source OK
t\05_lexer_practical.t source OK
t\06_round_trip.t: Bareword file handle opened at line 62, column 13.
See pages 202,204 of PBP. (Severity: 5)
t\07_token.t source OK
t\08_regression.t: One-argument "bless" used at line 75, column 16. See
page 365 of PBP. (Severity: 5)
t\08_regression.t: One-argument "bless" used at line 105, column 16.
See page 365 of PBP. (Severity: 5)
t\09_normal.t source OK
t\10_statement.t source OK
t\11_util.t source OK
t\12_location.t source OK
t\13_data.t source OK
Warning: Can't parse code: Fatal error... regex failed to match in
'#!/usr/bin/perl -w
' when expected at C:/strawberry-perl/perl/site/lib/PPI/Token/Word.pm
line 137.
for 't\14_charsets.t' at C:\strawberry-perl\perl\bin/perlcritic line 195
at C:\strawberry-perl\perl\bin/perlcritic line 202
main::critique('HASH(0xbae688)', '.\Makefile.PL',
'.\inline2test.tpl', 'lib\PPI.pm', 't\01_compile.t', 't\02_api.t', 't\03_e
mpiric.t', 't\04_element.t', 't\05_lexer_practical.t', ...) called at
C:\strawberry-perl\perl\bin/perlcritic line 37
main::run() called at C:\strawberry-perl\perl\bin/perlcritic line 29