Skip Menu |

This queue is for tickets about the Perl-Tidy CPAN distribution.

Report information
The Basics
Id: 53183
Status: resolved
Priority: 0/
Queue: Perl-Tidy

People
Owner: Nobody in particular
Requestors: justincase [...] yopmail.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Extra level of indenation when stacking both opening and closing tockens
when using the following options:
--stack-opening-tokens
--stack-closing-tokens

this is produced:

my $opt_c = Text::CSV_XS->new( {
        binary       => 1,
        sep_char     => $opt_c,
        always_quote => 1,
} );

but this is what i believe should be produced:

my $opt_c = Text::CSV_XS->new( {
    binary       => 1,
    sep_char     => $opt_c,
    always_quote => 1,
} );

also, is it possible to remove the space between the stacked tokens to get this?

my $opt_c = Text::CSV_XS->new({
    binary       => 1,
    sep_char     => $opt_c,
    always_quote => 1,
 });

I too would love to find a way to get PT to produce exactly the output described in this ticket. If I end up with a spare tuit I'll see if I can produce a patch for the desired behavior but until then I guess this comment is just a +1 (or a "me too" if you're cynical ;-)
On Mon Sep 05 15:34:13 2011, SSCAFFIDI wrote: Show quoted text
> I too would love to find a way to get PT to produce exactly the output > described in this ticket. > > If I end up with a spare tuit I'll see if I can produce a patch for > the desired behavior but until > then I guess this comment is just a +1 (or a "me too" if you're > cynical ;-)
Also adding a me too. Also I suggest adding a new option 'stack-tokens', which triggers both 'stack-opening-tokens' and 'stack-closing-tokens', with abbreviation 'stk' ('st' is taken). This part is easy to do. The hard part is getting the indentation right. I've been looking through the code but am not yet clear on what needs to be done where.
This has been on the wishlist for some time but didn't make the latest release because it might require adding another pass through the source to make the indentation adjustment.
Version 20121207 with options -sot -sct -act=2 does this; see Changes file.