How do I make Perl::Critic show the offending policy in its output?
Asked Answered
D

2

5

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?

Deuteranope answered 11/7, 2011 at 20:18 Comment(0)
G
5

The --verbose command-line option can control this-- if you don't want to specify your own format, try the values 8 or 9. Both of these built-in formats contain the policy name. If you like one of them, you can add this line to your .perlcriticrc:

verbose = 8

(Or 9, if you prefer that format.)

Randy

Glomerulus answered 11/7, 2011 at 22:15 Comment(0)
E
5
verbose = %f line %l col %c\n    [%s] %p (%e) = %m\n    %r\n

Season to taste. You're after %p or perhaps %P. The specifiers are documented in perlcritic.

Electrobiology answered 11/7, 2011 at 20:45 Comment(0)
G
5

The --verbose command-line option can control this-- if you don't want to specify your own format, try the values 8 or 9. Both of these built-in formats contain the policy name. If you like one of them, you can add this line to your .perlcriticrc:

verbose = 8

(Or 9, if you prefer that format.)

Randy

Glomerulus answered 11/7, 2011 at 22:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.