Perl-Critic / Perl-Critic

The leading static analyzer for Perl. Configurable, extensible, powerful.
http://perlcritic.com
Other
181 stars 103 forks source link

\#\# no critic FAIL #743

Open hsmyers opened 7 years ago

hsmyers commented 7 years ago

example:

# Failed test 'Test::Perl::Critic for "blib\lib\Math\Constants.pm"' # at C:/Strawberry/perl/site/lib/Test/Perl/Critic.pm line 104. # # Perl::Critic had errors in "blib\lib\Math\Constants.pm": # Can't parse code: Fatal error... regex failed to match in 'Φ : Constant(1.61803_39887_49894_84820_45868_3436563811); **## no critic_** # ' when expected at C:/Strawberry/perl/vendor/lib/PPI/Token/Word.pm line 240. t/author-critic.t ........ Dubious, test returned 1 (wstat 256, 0x100) Failed 1/1 subtests

thaljef commented 7 years ago

For the same reason as #742, this is an error from PPI. The "no critic" annotations only suppress policy violations, not parser failures.

Perhaps it would be helpful to have a more convenient way to skip files that we know are unparseable, rather than emitting an error. Like scanning the file for UTF-8 characters before handing to PPI.