first of all, kudos on the frequent releasing :)

I've attached a suggested patch to .perltidyrc. I've been playing around with perltidy'ing all QP code and some results I don't like. This doesn't fix all the things that I don't like, but it's been sitting on my laptop for a month so I thought I'd submit it to the ML for discussion. I haven't committed it to my git since I'd just revert it if it wasn't accepted :) Here's the relevant documentation to go along with the additions:

       -ce,   --cuddled-else
Enable the "cuddled else" style, in which "else" and "elsif" are follow immediately after the curly brace closing the previous block. The default is not to use cuddled elses, and is indicated with the flag -nce or --nocuddled-else. Here is a comparison of the alternatives:

             if ($task) {
                 yyy();
             } else {    # -ce
                 zzz();
             }

             if ($task) {
                   yyy();
             }
             else {    # -nce  (default)
                   zzz();
             }



       [-nbcc], -bbc,  --blanks-before-comments
A blank line will be introduced before a full-line comment. This is the default. Use -nbbc or --noblanks-before-comments to prevent such blank lines from being introduced.



       -msc=n,  --minimum-space-to-comment=n
Side comments look best when lined up several spaces to the right of code. Perltidy will try to keep comments at least n spaces to the right. The default is n=4 spaces.



-Jared
diff --git a/.perltidyrc b/.perltidyrc
index 65b29f2..9ffed84 100644
--- a/.perltidyrc
+++ b/.perltidyrc
@@ -10,6 +10,10 @@
 -lp     # line up with parentheses
 -cti=1  # align closing parens with opening parens ("closing token placement")
 
+-ce     # cuddled else
+-nbbc   # don't insert blank lines before comments
+-msc=1  # minimum one space before side comments (default 4)
+
 # -nolq # don't outdent long quotes (not sure if we should enable this)
 
 

Reply via email to