Give up on perltidy?

Ovid on 2006-01-13T19:23:28

After no one was able to answer this question about perltidy formatting, I'm at the verge of never using it again. I've read through the perltidy docs, made sure I had the latest version, checked out other people's perltidyrc files and it all comes down to this:

my %hash = ( 
    some_long_key => {
        INCLUDE_PATH => __PACKAGE__->path_to('www/templates/tt')
    }
);

I want that to remain unchanged. No matter what perltidyrc I try, I can't seem to do that even though that looks like a pretty standard way of formatting that. Theory (my boss) has the same problem. We really don't want to spend a lot of time on stupid stuff like this because whether or not an else is cuddled doesn't pay the bills. However, whether or not the code is readable makes a difference in how fast one can understand the code. Aesthetic considerations may sound silly, but they really do matter.


It has its uses

itub on 2006-01-13T19:32:02

I never use perltidy on my own code, but I use it in other people's code. ;-) While perltidy and I may not agree 100% of the time, it's at least >95%. Some people's coding style agree with mine 0%!

-ci=0 -cti=1

daerr on 2006-01-13T21:38:25

Seems to do the trick...

Re:-ci=0 -cti=1

Ovid on 2006-01-13T21:46:40

If you run perltidy on this:

my %hash = (
    some_long_key => {
        INCLUDE_PATH => __PACKAGE__->path_to('www/templates/tt')
    }
);

... and it doesn't change, then it's something else you're doing. Those two options by themselves generate this:

my %hash =
( some_long_key =>
    { INCLUDE_PATH => __PACKAGE__->path_to('www/templates/tt') } );

Try this

Mr. Muskrat on 2006-01-13T22:22:38

This works for me: perltidy -l=64 -i=4 some_long_key.pl

Re:Try this

Ovid on 2006-01-13T22:34:52

That does indeed work but limiting my line lengths to 64 characters is awful :(

Re:Try this

Mr. Muskrat on 2006-01-14T00:41:12

That's a very good point that would have been obvious if I'd run this on additional code.

Add a comment!

Mr. Muskrat on 2006-01-14T00:45:01

I added an empty comment and it started working with just -i=4.
my %hash = (
    some_long_key => {
        INCLUDE_PATH => __PACKAGE__->path_to('www/templates/tt')    #
    }
);