Docs
Reference for all the possible perltidy options
More detailed explanation of some the options
Team perltidy options
rule | explanation | notes |
---|---|---|
-i=4 | 4 column indent | A lot of the legacy code has 2 column indent. |
-pt=2 | "horizontal tightness" 2 - no space for parenthesis tokens | if ( ( my $len_tab = length( $tabstr ) ) > 0 ) { # -pt=0 if ( ( my $len_tab = length($tabstr) ) > 0 ) { # -pt=1 (default) if ((my $len_tab = length($tabstr)) > 0) { # -pt=2(docs) |
-wls='=>' | ensure there's always space to the left of => | |
-wrs='=>' | ...and always to the right of => | |
-vtc=0 | always break before a closing token (default) | i.e. non-block curly braces, parentheses, and square brackets docs |
-l=79 | Lines should be no more than 79 characters wide | |
-nolc | no "outdenting" for long comments - indent them properly | By default, full-line (block) comments longer than the value maximum-line-length will have their indentation removed ("outdented"). This rule prevents that. docs |
-nolq | no "outdenting" for long quotes/strings | docs |
-sot | stack opening tokens - same as -sop -sohb -sosb | Put opening parentheses, braces, etc. on the same line docs |
-sct | stack closing tokens | Put closing parentheses, braces, etc. on the same line docs |
Options that were removed
rule | explanation | notes |
---|---|---|
-lp | line up parentheses | See docs |
-vt=2 | define opening vertical tightness | Put opening parentheses, braces, etc. on the same line. Related to -lp docs |
-vt=0 | always break a line after opening token | docs |
-st -se | use as a filter | Instructions to the parser docs |
-nsfs | 'for' loop semicolon spaces | The default is to place a space before a semicolon in a for statement, like this: for ( @a = @$ap, $u = shift @a ; @a ; $u = $v ) { # -sfs (default) If you prefer no such space, like this: for ( @a = @$ap, $u = shift @a; @a; $u = $v ) { # -nsfs then use nsfs. |
-nbbc | No blanks before comments | By default, a blank line will be introduced before a full-line comment. This rule prevents that. |