perltidy help needed

domm on 2009-06-09T19:28:11

As we all know, perltidy is a very cool and powerful tool, and I love it. But there's one thing I cannot get it to do, which is best explained as code...

I would like to get this as a result:

$self->do_something( $c, {
    rs              => $c->model('DB::Foo')->search( { bar => 'baz' } ),
    fluxcompensator => '1.21 jigowatts',
});

Specifically, I want the ( $c, { on the same line and the contents of the hash only indented on level deeper.

I played around with a lot of settings, but could only get this:

$self->do_something(
    $c, {
        rs              => $c->model('DB::Foo')->search( { bar => 'baz' } ),
        fluxcompensator => '1.21 jigowatts'
    });

using

--stack-opening-tokens 
--stack-closing-tokens
--opening-brace-always-on-right
--opening-token-right

I also tried --line-up-parentheses like this (additional to the above options):

--line-up-parentheses
--closing-token-indentation=0
--vertical-tightness=2
with this result:
$self->do_something( $c, {
                        rs =>
                            $c->model('DB::Foo')->search( { bar => 'baz' } ),
                        fluxcompensator => '1.21 jigowatts'
                     } );

Now the $c and { line up, but I do not like the fact that rs=> etc is indented that much.

So, dear lazyweb: What's the right perltidy setting? Or does perltidy simply not support my favourite coding style?