Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

Unfortunately, this only counts discrepancy in lines. It's a sort of Levenshtein Distance of lines.

Typically, smart-indenting editors and perltidy can only approximate each other's code (since both are essentially trying to "parse" the syntax, and as we know, only perl can parse Perl). Emacs and perltidy can come close, but don't always agree. I tidy up some foreign code when I get it, then edit from there without re-tidying. So some level of disagreement is quite common.

For a better result, I'd like to see a patch to perltidy where it accumulates a "cost to fix" for each situation it wants to fix. Then you're not post-processing perltidy, but asking perltidy itself: how bad was this sloppy code, quantitatively?

I'd also like a minor mode in emacs where it occasionally executes (perl -c $filename) invisibly, then slightly tints the background of all the lines following the first error found (or better, though I think unsupported, is to tint the relevant fraction of the buffer's scrollbar). You could adjust this to do the same for perltidy... highlighting the first egregious tidy problem.

--
[ e d @ h a l l e y . c c ]


In reply to Re: PerlMessy: Perltidy's little tattletaling sister by halley
in thread PerlMessy: Perltidy's little tattletaling sister by jacques

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others musing on the Monastery: (7)
    As of 2014-09-20 09:35 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (158 votes), past polls