Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

mpeters (5802)

mpeters
  (email not shown publicly)
http://petersfamily.org/
AOL IM: michael00peters (Add Buddy, Send Message)

Technorati Profile [technorati.com]

Journal of mpeters (5802)

Tuesday June 09, 2009
03:37 PM

Another perltidy lazyweb request

[ #39107 ]
Having been inspired by Domm to fix one of my perltidy annoyances (it says something about the greatness of a tool that I keep using it even though there are some annoyances...).
I have these .perltidyrc settings:

--indent-columns=4
--cuddled-else
--nooutdent-long-quotes
--paren-tightness=2
--brace-tightness=2
--square-bracket-tightness=2

And I have this code:

Some::Class->create(
    {
        foo => 3,
        bar => 2,
        baz => 1,
    }
);

Now I want those opening and closing tokens to be closer together and not waste so much vertical space. So I added this:

--stack-opening-tokens
--stack-closing-tokens

Now my code looks like this:

Some::Class->create({
        foo => 3,
        bar => 2,
        baz => 1,
});

Which is fabulous except that the inner args are indented 2 levels (8 spaces) instead of just 1 (4 spaces). So how do I get this?

Some::Class->create({
    foo => 3,
    bar => 2,
    baz => 1,
});

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Let me just second that.

    I don't think that's configurable since it's a bit of a special case to only want to indent one of the structures.

    Unfortunately Perl::Tidy doesn't seem to have any tests to speak of, so it's a bit of an effort to start hacking on it to add missing bits.