无法让策略 Perl::Critic::Policy::Tics::ProhibitLongLines 工作
我有:
- Ubuntu 10.04
- Perlbrew 0.39
- 切换到 Perl 5.12.3。使用 perlbrew
- 安装 Perl::Critic 和 Perl::Critic::Tics 并使用 cpanm
我的 .perlcriticrc 文件:
severity = 1
only= 1
[CodeLayout::ProhibitHardTabs]
allow_leading_tabs = 0
[Perl::Critic::Policy::CodeLayout::RequireConsistentNewlines]
[Perl::Critic::Policy::Tics::ProhibitLongLines]
base_max = 120
hard_max = 130
pct_allowed = 5
[Perl::Critic::Policy::OTRS::RequireCamelCase]
其他策略按预期运行,但每当一行超过由 Hard_max 定义的长度时,我收到警告消息:
Use of uninitialized value $min_width in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 51.
Use of uninitialized value $replength in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 51.
Use of uninitialized value $max_width in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 56.
Use of uninitialized value $replength in numeric gt (>) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 56.
Use of uninitialized value $replength in subtraction (-) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 67.
Use of uninitialized value $min_width in subtraction (-) at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 67.
Use of uninitialized value $replacement in concatenation (.) or string at /home/birdy/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/String/Format.pm line 67.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对我来说似乎是一个错误。即使我完全忽略我的
.perlcriticrc
文件,我也会收到相同的警告:我使用的是 perl 5.12.2。
您应该针对 href="http://search.cpan.org/perldoc?Perl%3a%3aCritic%3a%3aTics" rel="nofollow">Perl::Critic::Tics。我已经检查了
Tics
和 Perl::Critic,但我没有找到任何与String::Format
相关的内容。确保您拥有最新版本的Critic
和Tics
。我有当前的Tics
(0.006),但我的Critic
有点过时 (1.111)。This seems like a bug to me. I get the same warnings even if I completely ignore my
.perlcriticrc
file:I am on perl 5.12.2.
You should submit a bug report against Perl::Critic::Tics. I have checked the
Changes
files for bothTics
and Perl::Critic, but I did not find anything relevant toString::Format
. Make sure you have recent versions ofCritic
andTics
. I have the currentTics
(0.006), but myCritic
is a little outdated (1.111).