如何让 Perl::Critic 在其输出中显示违规策略?
I've been told it's possible to have Perl::Critic
show the policy name that is offending in its output. But I can't recall what I have to do to turn this on. How can this be enabled in a perlcritic.rc
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
--verbose
命令行选项可以控制这一点 - 如果您不想指定自己的格式,请尝试值8
或9.这两种内置格式都包含策略名称。如果您喜欢其中之一,您可以将此行添加到您的
.perlcriticrc
中:(或者 9,如果您喜欢这种格式。)
Randy
The
--verbose
command-line option can control this-- if you don't want to specify your own format, try the values8
or9
. Both of these built-in formats contain the policy name. If you like one of them, you can add this line to your.perlcriticrc
:(Or 9, if you prefer that format.)
Randy
调味。您正在寻找
%p
或%P
。说明符记录在 perlcritic 中。Season to taste. You're after
%p
or perhaps%P
. The specifiers are documented in perlcritic.