Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

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


In reply to Re: CPAN's perltidy to the rescue! by davido
in thread CPAN's perltidy to the rescue! by tfredett

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (None)
    As of 2024-04-18 23:42 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found