Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: CPAN's perltidy to the rescue!

by davido (Archbishop)
on Jul 13, 2012 at 19:06 UTC ( #981705=note: print w/ replies, xml ) Need Help??


in reply to CPAN's perltidy to the rescue!

I agree. I think perltidy is great. (That's perltidy for the search-impared).

I feel more productive when I keep my code formatted reasonably well as I'm working with it. But before significant commits (especially ones that will get merged back into a more stable branch), I usually pass it through perltidy first (This works out best if everyone plays by the same rules, or else your 'git diff' becomes a log of all the changes perltidy made, and the potential for merge rejects increases). Often when I compare what I thought was reasonable formatting with what perltidy comes up with, I have to agree with its assessment. But there's a consistent issue that always bugged me. It has to do with how it chooses to indent a qw// list (by default). Here's a contrived example:

# How I like to see it. my @stuff = qw( some big list of items that spans several rows ); # How perltidy likes to see it. my @stuff = qw( some big list of items that spans several rows );

Finally it annoyed me enough that I dug into the docs and discovered the -ntqw command line switch. Much happier now. :)


Dave


Comment on Re: CPAN's perltidy to the rescue!
Select or Download Code
Re^2: CPAN's perltidy to the rescue!
by Riales (Hermit) on Jul 13, 2012 at 19:32 UTC

    That's the sort of thing nobody can agree on; here's how I like to see it:

    my @stuff = qw/ some big list of items that spans several rows /;

    It's really awesome that perltidy lets you customize all that!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://981705]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (9)
As of 2014-12-25 22:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (163 votes), past polls