changeset 439:196433933b98

Completed the support for all perl tidy parameters. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@674 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Thu, 15 May 2008 12:52:53 +0000
parents 9e198e9f5f7b
children e501511d7338
files indenters/uigui_perltidy.ini
diffstat 1 files changed, 239 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/indenters/uigui_perltidy.ini	Mon May 12 18:09:57 2008 +0000
+++ b/indenters/uigui_perltidy.ini	Thu May 15 12:52:53 2008 +0000
@@ -1,5 +1,5 @@
 [%20header]
-categories=Styles|Basic Options|Code Indentation Control|Whitespace Control|Comment Controls|Skip Selected Codesections|Line Break Control|Controlling List Formatting
+categories=Styles|Basic Options|Code Indentation Control|Whitespace Control|Comment Controls|Skip Selected Codesections|Line Break Control|Controlling List Formatting|Retaining or Ignoring Existing Line Breaks|Blank Line Control|Other Controls
 cfgFileParameterEnding=cr
 configFilename=perltidy.cfg
 fileTypes=*.pl|*.pm
@@ -891,3 +891,241 @@
 Enabled=false
 Value=
 ValueDefault=
+
+[Break at old comma breakpoints]
+Category=7
+Description="<html><dd><p>This flag tells perltidy to try to break at all old commas.  This is not the default.  Normally, perltidy makes a best guess at list formatting, and seldom uses old comma breakpoints.  Usually this works well, but consider:</p></dd><dd><pre>\n    my @list = (1,\n                1, 1,\n                1, 2, 1,\n                1, 3, 3, 1,\n                1, 4, 6, 4, 1,);</pre></dd><dd><p>The default formatting will flatten this down to one line:</p></dd><dd><pre>\n    # perltidy (default)\n    my @list = ( 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 6, 4, 1, );</pre></dd><dd><p>which hides the structure. Using <strong>-boc</strong>, plus additional flags to retain the original style, yields</p></dd><dd><pre>\n    # perltidy -boc -lp -pt=2 -vt=1 -vtc=1\n    my @list = (1,\n                1, 1,\n                1, 2, 1,\n                1, 3, 3, 1,\n                1, 4, 6, 4, 1,);</pre></dd><dd><p>A disadvantage of this flag is that all tables in the file must already be nicely formatted.  For another possibility see the -fs flag in Skipping Selected Sections of Code.</p></dd></html>"
+EditorType=boolean
+TrueFalse=--break-at-old-comma-breakpoints|
+Value=0
+ValueDefault=0
+
+[Maximum fields per table]
+CallName="--maximum-fields-per-table="
+Category=7
+Description="<html><dd><p>If the computed number of fields for any table exceeds <strong>n</strong>, then it will be reduced to <strong>n</strong>.  The default value for <strong>n</strong> is a large number, 40.  While this value should probably be left unchanged as a general rule, it might be used on a small section of code to force a list to have a particular number of fields per line, and then either the <strong>-boc</strong> flag could be used to retain this formatting, or a single comment could be introduced somewhere to freeze the formatting in future applications of perltidy.</p></dd><dd><pre>\n    # perltidy -mft=2\n    @month_of_year = (    \n        'Jan', 'Feb',\n        'Mar', 'Apr',\n        'May', 'Jun',\n        'Jul', 'Aug',\n        'Sep', 'Oct',\n        'Nov', 'Dec'\n    );</pre></dd></html>"
+EditorType=numeric
+Enabled=false
+MaxVal=9999
+MinVal=0
+Value=40
+ValueDefault=40
+
+[Comma arrow breakpoints]
+CallName="--comma-arrow-breakpoints="
+Category=7
+Description="<html><dd><p>A comma which follows a comma arrow, '=&gt;', requires special consideration.  In a long list, it is common to break at all such commas.  This parameter can be used to control how perltidy breaks at these commas.  (However, it will have no effect if old comma breaks are being forced because <strong>-boc</strong> is used).  The possible values of <strong>n</strong> are:</p></dd><dd><pre>\n n=0 break at all commas after =&gt;  \n n=1 stable: break at all commas after =&gt; unless this would break\n     an existing one-line container (default)\n n=2 break at all commas after =&gt;, but try to form the maximum\n     maximum one-line container lengths\n n=3 do not treat commas after =&gt; specially at all</pre></dd><dd><p>For example, given the following single line, perltidy by default will not add any line breaks because it would break the existing one-line container:</p></dd><dd><pre>\n    bless { B =&gt; $B, Root =&gt; $Root } =&gt; $package;</pre></dd><dd><p>Using <strong>-cab=0</strong> will force a break after each comma-arrow item:</p></dd><dd><pre>\n    # perltidy -cab=0:\n    bless {\n        B    =&gt; $B,\n        Root =&gt; $Root\n    } =&gt; $package;</pre></dd><dd><p>If perltidy is subsequently run with this container broken, then by default it will break after each '=&gt;' because the container is now broken.  To reform a one-line container, the parameter <strong>-cab=2</strong> would be needed.</p></dd><dd><p>The flag <strong>-cab=3</strong> can be used to prevent these commas from being treated specially.  In this case, an item such as ``01'' =&gt; 31 is treated as a single item in a table.  The number of fields in this table will be determined by the same rules that are used for any other table. Here is an example.</p></dd><dd><pre>\n    # perltidy -cab=3\n    my %last_day = (\n        &quot;01&quot; =&gt; 31, &quot;02&quot; =&gt; 29, &quot;03&quot; =&gt; 31, &quot;04&quot; =&gt; 30,\n        &quot;05&quot; =&gt; 31, &quot;06&quot; =&gt; 30, &quot;07&quot; =&gt; 31, &quot;08&quot; =&gt; 31,\n        &quot;09&quot; =&gt; 30, &quot;10&quot; =&gt; 31, &quot;11&quot; =&gt; 30, &quot;12&quot; =&gt; 31\n    );</pre></dd></html>"
+EditorType=numeric
+Enabled=false
+MaxVal=3
+MinVal=0
+Value=3
+ValueDefault=3
+
+[Break at old logical breakpoints]
+Category=8
+Description="<html><p>By default, if a logical expression is broken at a <code>&amp;&amp;</code>, <code>||</code>, <code>and</code>, or <code>or</code>, then the container will remain broken.  Also, breaks at internal keywords <code>if</code> and <code>unless</code> will normally be retained. To prevent this, and thus form longer lines, use <strong>-nbol</strong>.</p></html>"
+EditorType=boolean
+TrueFalse=--break-at-old-logical-breakpoints|
+Value=0
+ValueDefault=0
+
+[Break at old keyword breakpoints]
+Category=8
+Description="<html><p>By default, perltidy will retain a breakpoint before keywords which may return lists, such as <code>sort</code> and &lt;map&gt;.  This allows chains of these operators to be displayed one per line.  Use <strong>-nbok</strong> to prevent retaining these breakpoints.</p></html>"
+EditorType=boolean
+TrueFalse=--break-at-old-keyword-breakpoints|
+Value=0
+ValueDefault=0
+
+[Break at old ternary breakpoints]
+Category=8
+Description="<html><p>By default, if a conditional (ternary) operator is broken at a <code>:</code>, then it will remain broken.  To prevent this, and thereby form longer lines, use <strong>-nbot</strong>.</p></html>"
+EditorType=boolean
+TrueFalse=--break-at-old-ternary-breakpoints|
+Value=0
+ValueDefault=0
+
+[Ignore old breakpoints]
+Category=8
+Description="<html><p>Use this flag to tell perltidy to ignore existing line breaks to the maximum extent possible.  This will tend to produce the longest possible containers, regardless of type, which do not exceed the line length limit.</p></html>"
+EditorType=boolean
+TrueFalse=--ignore-old-breakpoints|
+Value=0
+ValueDefault=0
+
+[Keep interior semicolons] 
+Category=8
+Description="<html><dd><p>Use the <strong>-kis</strong> flag to prevent breaking at a semicolon if there was no break there in the input file.  Normally perltidy places a newline after each semicolon which terminates a statement unless several statements are contained within a one-line brace block.  To illustrate, consider the following input lines:</p></dd><dd><pre>\n    dbmclose(%verb_delim); undef %verb_delim;\n    dbmclose(%expanded); undef %expanded;</pre></dd><dd><p>The default is to break after each statement, giving</p></dd><dd><pre>\n    dbmclose(%verb_delim);\n    undef %verb_delim;\n    dbmclose(%expanded);\n    undef %expanded;</pre></dd><dd><p>With <strong>perltidy -kis</strong> the multiple statements are retained:</p></dd><dd><pre>\n    dbmclose(%verb_delim); undef %verb_delim;\n    dbmclose(%expanded);   undef %expanded;</pre></dd><dd><p>The statements are still subject to the specified value of <strong>maximum-line-length</strong> and will be broken if this maximum is exceeed.</p></dd></html>"
+EditorType=boolean
+TrueFalse=--keep-interior-semicolons|
+Value=0
+ValueDefault=0
+
+[Blanks before comments]
+Category=9
+Description="<html><p>A blank line will be introduced before a full-line comment.  This is the default.  Use <strong>-nbbc</strong> or  <strong>--noblanks-before-comments</strong> to prevent such blank lines from being introduced.</p></html>"
+EditorType=boolean
+TrueFalse=--blanks-before-comments|
+Value=0
+ValueDefault=0
+
+[Blanks before subs]
+Category=9
+Description="<html><p>A blank line will be introduced before a <strong>sub</strong> definition, unless it is a one-liner or preceded by a comment.  A blank line will also be introduced before a <strong>package</strong> statement and a <strong>BEGIN</strong> and <strong>END</strong> block.  This is the default.  The intention is to help display the structure of a program by setting off certain key sections of code.  This is negated with <strong>-nbbs</strong> or <strong>--noblanks-before-subs</strong>.</p></html>"
+EditorType=boolean
+TrueFalse=--blanks-before-subs|
+Value=0
+ValueDefault=0
+
+[Blanks before blocks]
+Category=9
+Description="<html><dd><p>A blank line will be introduced before blocks of coding delimited by <strong>for</strong>, <strong>foreach</strong>, <strong>while</strong>, <strong>until</strong>, and <strong>if</strong>, <strong>unless</strong>, in the following circumstances:</p></dd><ul><li><p>The block is not preceded by a comment.</p></li><li><p>The block is not a one-line block.</p></li><li><p>The number of consecutive non-blank lines at the current indentation depth is at least <strong>-lbl</strong> (see next section).</p></li></ul><p>This is the default.  The intention of this option is to introduce some space within dense coding. This is negated with <strong>-nbbb</strong> or  <strong>--noblanks-before-blocks</strong>.</p></html>"
+EditorType=boolean
+TrueFalse=--blanks-before-blocks|
+Value=0
+ValueDefault=0
+
+[Long block line count]
+CallName="--long-block-line-count="
+Category=9
+Description="<html><p>This controls how often perltidy is allowed to add blank lines before certain block types (see previous section).  The default is 8.  Entering a value of <strong>0</strong> is equivalent to entering a very large number.</p></html>"
+EditorType=numeric
+Enabled=false
+MaxVal=9999
+MinVal=0
+Value=8
+ValueDefault=8
+
+[Maximum consecutive blank lines]
+CallName="--maximum-consecutive-blank-lines="
+Category=9
+Description="<html><p>This parameter specifies the maximum number of consecutive blank lines in the output script.  The default is n=1.  If the input file has more than n consecutive blank lines, the number will be reduced to n. (This obviously does not apply to pod sections, here-documents, and quotes).</p></html>"
+EditorType=numeric
+Enabled=false
+MaxVal=9999
+MinVal=0
+Value=1
+ValueDefault=1
+
+[Swallow optional blank lines]
+Category=9
+Description="<html><p>All blank lines not required by the above flags, <strong>-bbb</strong>, <strong>-bbs</strong>, and <strong>-bbc</strong>, will be deleted.  (But essential blank lines above pod documents will be retained).  This is NOT the default.</p></html>"
+EditorType=boolean
+TrueFalse=--swallow-optional-blank-lines|
+Value=0
+ValueDefault=0
+
+[Noswallow optional blank lines]
+Category=9
+Description="<html><p>Retain blank lines, including those which do not corresponding to flags <strong>-bbb</strong>, <strong>-bbs</strong>, and <strong>-bbc</strong>.  This is the default.  The number of blanks retained is subject to the limit imposed by <strong>--maximum-consecutive-blank-lines</strong>, however.</p></html>"
+EditorType=boolean
+TrueFalse=--noswallow-optional-blank-lines|
+Value=0
+ValueDefault=0
+
+[Delete all comments]
+Category=10
+Description="<html><p>Perltidy can selectively delete comments and/or pod documentation.  The command <strong>-dac</strong> or  <strong>--delete-all-comments</strong> will delete all comments <strong>and</strong> all pod documentation, leaving just code and any leading system control lines.</p></html>"
+EditorType=boolean
+TrueFalse=--delete-all-comments|
+Value=0
+ValueDefault=0
+
+[Delete pod]
+Category=10
+Description="<html><p>The command <strong>-dp</strong> or <strong>--delete-pod</strong> will remove all pod documentation (but not comments).</p></html>"
+EditorType=boolean
+TrueFalse=--delete-pod|
+Value=0
+ValueDefault=0
+
+[Delete block comments]
+Category=10
+Description="<html><p>Two commands which remove comments (but not pod) are: <strong>-dbc</strong> or <strong>--delete-block-comments</strong> and <strong>-dsc</strong> or  <strong>--delete-side-comments</strong>. (Hanging side comments will be deleted with block comments here.)</p></html>"
+EditorType=boolean
+TrueFalse=--delete-block-comments|
+Value=0
+ValueDefault=0
+
+[Delete side comments]
+Category=10
+Description="<html><p>Two commands which remove comments (but not pod) are: <strong>-dbc</strong> or <strong>--delete-block-comments</strong> and <strong>-dsc</strong> or  <strong>--delete-side-comments</strong>. (Hanging side comments will be deleted with block comments here.)</p></html>"
+EditorType=boolean
+TrueFalse=--delete-side-comments|
+Value=0
+ValueDefault=0
+
+[Tee all comments]
+Category=10
+Description="<html><p>When perltidy writes a formatted text file, it has the ability to also send selected text to a file with a <em>.TEE</em> extension.  This text can include comments and pod documentation.</p><p>The command <strong>-tac</strong> or <strong>--tee-all-comments</strong> will write all comments <strong>and</strong> all pod documentation.</p></html>"
+EditorType=boolean
+TrueFalse=--tee-all-comments|
+Value=0
+ValueDefault=0
+
+[Tee pod]
+Category=10
+Description="<html><p>When perltidy writes a formatted text file, it has the ability to also send selected text to a file with a <em>.TEE</em> extension.  This text can include comments and pod documentation.</p><p>The command <strong>-tp</strong> or <strong>--tee-pod</strong> will write all pod documentation (but not comments).</p></html>"
+EditorType=boolean
+TrueFalse=--tee-pod|
+Value=0
+ValueDefault=0
+
+[Tee block comments]
+Category=10
+Description="<html><p>When perltidy writes a formatted text file, it has the ability to also send selected text to a file with a <em>.TEE</em> extension.  This text can include comments and pod documentation.</p><p>The commands which write comments (but not pod) are: <strong>-tbc</strong> or <strong>--tee-block-comments</strong> and <strong>-tsc</strong> or  <strong>--tee-side-comments</strong>. (Hanging side comments will be written with block comments here.)</p></html>"
+EditorType=boolean
+TrueFalse=--tee-block-comments|
+Value=0
+ValueDefault=0
+
+[Tee side comments]
+Category=10
+Description="<html><p>When perltidy writes a formatted text file, it has the ability to also send selected text to a file with a <em>.TEE</em> extension.  This text can include comments and pod documentation.</p><p>The commands which write comments (but not pod) are: <strong>-tbc</strong> or <strong>--tee-block-comments</strong> and <strong>-tsc</strong> or  <strong>--tee-side-comments</strong>. (Hanging side comments will be written with block comments here.)</p></html>"
+EditorType=boolean
+TrueFalse=--tee-side-comments|
+Value=0
+ValueDefault=0
+
+[Look for hash bang]
+Category=10
+Description="<html><p>If your script has leading lines of system commands or other text which are not valid perl code, and which are separated from the start of the perl code by a ``hash-bang'' line, ( a line of the form <code>#!...perl</code> ), you must use the <strong>-x</strong> flag to tell perltidy not to parse and format any lines before the ``hash-bang'' line.  This option also invokes perl with a -x flag when checking the syntax.  This option was originally added to allow perltidy to parse interactive VMS scripts, but it should be used for any script which is normally invoked with <code>perl -x</code>.</p></html>"
+EditorType=boolean
+TrueFalse=--look-for-hash-bang|
+Value=0
+ValueDefault=0
+
+[Making a file unreadable]
+Category=10
+Choices=--mangle|--extrude
+ChoicesReadable=Mangle|Extrude
+Description="<html><dd><p>The goal of perltidy is to improve the readability of files, but there are two commands which have the opposite effect, <strong>--mangle</strong> and <strong>--extrude</strong>.  They are actually merely aliases for combinations of other parameters.  Both of these strip all possible whitespace, but leave comments and pod documents, so that they are essentially reversible.  The difference between these is that <strong>--mangle</strong> puts the fewest possible line breaks in a script while <strong>--extrude</strong> puts the maximum possible. Note that these options do not provided any meaningful obfuscation, because perltidy can be used to reformat the files.  They were originally developed to help test the tokenization logic of perltidy, but they have other uses. One use for <strong>--mangle</strong> is the following:</p></dd><dd><pre>\n  perltidy --mangle myfile.pl -st | perltidy -o myfile.pl.new</pre></dd><dd><p>This will form the maximum possible number of one-line blocks (see next section), and can sometimes help clean up a badly formatted script.</p></dd><dd><p>A similar technique can be used with <strong>--extrude</strong> instead of <strong>--mangle</strong> to make the minimum number of one-line blocks.</p></dd><dd><p>Another use for <strong>--mangle</strong> is to combine it with <strong>-dac</strong> to reduce the file size of a perl script.</p></dd></html>"
+EditorType=multiple
+Enabled=false
+Value=0
+ValueDefault=0
+
+[MakeMaker]
+Category=10
+Description="<html><p>The first $VERSION line of a file which might be eval'd by MakeMaker is passed through unchanged except for indentation. Use --nopass-version-line, or -npvl, to deactivate this feature.</p></html>"
+EditorType=boolean
+TrueFalse=--nopass-version-line|
+Value=0
+ValueDefault=0
+
+[AutoLoader]
+Category=10
+Description="<html><p>If the AutoLoader module is used, perltidy will continue formatting code after seeing an __END__ line. Use --nolook-for-autoloader, or -nlal, to deactivate this feature.</p></html>"
+EditorType=boolean
+TrueFalse=--nolook-for-autoloader|
+Value=0
+ValueDefault=0
+
+[SelfLoader]
+Category=10
+Description="<html><p>Likewise, if the SelfLoader module is used, perltidy will continue formatting code after seeing a __DATA__ line. Use --nolook-for-selfloader, or -nlsl, to deactivate this feature.</p></html>"
+EditorType=boolean
+TrueFalse=--nolook-for-selfloader|
+Value=0
+ValueDefault=0