On 28/06/07, Bernhard Schmalhofer <[EMAIL PROTECTED]> wrote:
Paul Cochrane (via RT) schrieb:
> # New Ticket Created by  Paul Cochrane
> # Please include the string:  [perl #43413]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=43413 >
>
>
> Hi,
>
> In perlcritic.t i'd like to find a way to pass options to perlcritic
> policies from the command line.  Options are passed as anonymous
> hashes.  Basically, we want to be able to do something like:
>
> perl t/codingstd/perlcritic.t --list
> --policy=CodeLayout::ProhibitHardTabs=>{'allow_leading_tabs'=>0}
>
> and it to give the output:
>
> CodeLayout::ProhibitHardTabs => \{
>    'allow_leading_tabs' => 0
>  }
>
Isn't that reimplementing 'perlcritic' ?
If somebody wants to work on satisfying a new policy one can set up a
my_perlcriticrc file and call

   perlcritic --profile my_perlcriticrc

This is actually intended at satisfying currently used policies within
perlcritic.t.  There are two policies which take arguments, and it'd
be nice to be able to run these policies individually with the
arguments as specified in perlcritic.t, because just using
CodeLayout::ProhibitHardTabs allows leading hard tabs.

Hrm, having had to explain this ticket I think I've found a better
solution.  We just want to specify the policy to run at the command
line, and then any standard options which perlcritic.t would want to
use for that policy should then be set; such options shouldn't be set
by the user on the command line.

Another question. Can we simplify perlcritic.t by using Test::Perl::Critic?

I don't know.  Would you be able to explain how this would simplify
the internals of perlcritic.t?  I don't have much experience with
T::P::C.

Paul

Reply via email to