<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">El 25/09/15 a las 16:41, Diego Kuperman
      escribió:<br>
    </div>
    <blockquote cite="mid:56055D2F.7020807@kuperman.com.ar" type="cite">Hola!,
      <br>
      <br>
      On 25/09/15 08:51, Alba Ferrer wrote:
      <br>
      <blockquote type="cite">
        <blockquote type="cite">La opción es la
          <br>
          <br>
          -bbc
          <br>
          -blank-before-comments
          <br>
          <br>
          activa por defecto.
          <br>
        </blockquote>
        genial, gracias!
        <br>
        <br>
        <blockquote type="cite">De todos modos, hay otra forma de hacer
          que perltidy "no toque" un
          <br>
          determinado bloque de comentarios. Es la sección Static Block
          Comments. Por
          <br>
          defecto es con '##', pero se puede cambiar.
          <br>
        </blockquote>
        sí, visto, pero me daba rabia lo de -bbc :-P
        <br>
      </blockquote>
      Nos compartes tu .perltidyrc ? :-)
      <br>
      <br>
    </blockquote>
    <br>
    Ahí va el mío.<br>
    <br>
    He puesto algunos comentarios en algunos de ellos, por temas de
    incompatibilidades con otras opciones (por ejemplo, -b es
    incompatible con -bpb).<br>
    <br>
    Cuidado, porque a veces hay que buscarle el truco a las opciones -b
    y -nst: si llamamos a perltidy como un filtro externo desde nuestro
    editor, no es necesario que nos cree un .bak, así que es mejor
    desactivar la opción -b. Y la -nst va según cómo trabaje nuestro
    editor a la hora de pasar a Perltidy un bloque o todo el código
    (usando STDOUT o un archivo temporal).<br>
    <br>
    También hay algunas cosas personales, como por ejemplo, desactivar <i>Static
      Blocks Comments</i>, porque a veces sí que uso '##' para otras
    cosas, y sí quiero que sean formateados como el resto de
    comentarios.<br>
    <br>
    Hay cosas curiosas que se han ido acumulando con los años: -wbb
    define los operadores por los que se puede "romper la línea", pero
    en las nuevas versiones de Perltidy apareció la opción -bbao, con lo
    que engloba a todos los operadores, y ya no es necesario ponerlos
    todos en -wbb. O la longitud de la línea, que hace mucho que lo pasé
    de 80 a 120 columnas.<br>
    <br>
    Al menos, esta es la configuración que mejor me funciona con
    editores en terminal, como puede ser el joe y Eclipse (con
    e-p-i-c).  Ahora es tarde, pero mañana veo qué tal va con vim.<br>
    <br>
    <pre>#------
#------  A .perltidyrc configuration file for the nice tool Perltidy 
#------              You found it at <a class="moz-txt-link-abbreviated" href="http://www.leifove.com">www.leifove.com</a>.
#------  Note! Because of the -b option used below, the original Perl file
#------        is backed up by Perltidy, and the original then tidyied.  
#------  See CPAN. org for more info about where to store this file and
#------  how to call Perltidy on your source code files.
#------

#----------------  PBP options, as listed on page 35 of PBP  ----------------
-pbp    # equivale a:
-l=120   # Max line width is 78 cols
#-i=4    # Indent level is 4 cols
#-ci=4   # Continuation indent is 4 cols
#-st     # Salida por la standard-output
#-se     # Salida por la standard-error
#-vt=2   # Maximal vertical tightness
#-cti=0  # No extra indentation for closing brackets
#-pt=1   # Medium parenthesis tightness
#-bt=1   # Medium brace tightness (for non-code blocks)
#-sbt=1  # Medium square bracket tightness
#-bbt=1  # Medium block brace tightness (for code blocks)
#-nsfs   # No space before semicolons
#-nolq   # Don't outdent long quoted strings
        # Break before all operators:
#-wbb="% + - * / x != == >= <= =~ !~ < > | & = // **= += *= &= <<= &&= -= /= |= >>= ||= //= .= %= ^= x="
-bbao   # --break-before-all-operators.

# Note that the PBP book has a typo on page 35 when defining the above -wbb
# option, see <a class="moz-txt-link-freetext" href="http://oreilly.com/catalog/perlbp/errata/perlbp.confirmed">http://oreilly.com/catalog/perlbp/errata/perlbp.confirmed</a>
# The above string is correct.

#----------  Perltidy default options (i.e. in line with PBP)  --------------
-asc    # Add any missing optional semicolon at the end of a line
-aws    # Add certain whitespace to improve code readability
-tqw    # Default handling of multi-line 'qw' quotes
-ibc    # Indent block comments to same level as the code
-msc=4  # Minimum 4 spaces between code and same-line comments
-fpsc=48 # Don't try to line up all comments to a fixed column
-hsc    # Align hanging side comments
#-sbcp='^#{2,}[^\s#]'    # Enable static block comments
-nssc   # No special handling for static side comments
-dnl    # Delete old newlines
-bbc    # Ensure a blank line before every full-line comment
-bbs    # Ensure a blank line before every sub definition (except one-liners)
-bbb    # Ensure a blank line before code blocks (for, while, if, ....)
-lbl=8  # Minimum number of lines between each -bbb inserted blank line

#-------------  Additional options, based on PBP recommendations  ------------
-bar    # K&R style code braces
-nolc   # Long comments indented, even when this make the total line length "too long"
-noll   # Long lines indented, even when this make the total line length "too long"
-nola   # Don't treat labels as special cases when indenting

#----------  Options concerning Perltidy's input and ouput files  -----------
-nst    # Do NOT output to STDOUT (since we want to use -b)
#-b      # Backup the input file to .bak and perform all tidying in the original file. No se puede usar con -pbp
#-se     # Write errors to STDERR. Activado con -pbp
-ple    # Preserve the EOL character(s). E.g. in case Perltidy runs
        # on Windows, but processes a Perl file for Unix (and vice versa)

#-----------  Some other Perltidy options, intentionally not used   ----------
# The following Perltidy options are NOT consistent with PBP and should NOT be used:
# -lp, -icb, -fws, -nwls, -nwrs, -sfp, -sak/-nsak, -csc/dcsc, -fnl,
# -ce, -bl, -sbl, -bli, -blil, -bbvt, -otr, -sct, -boc, -kis,
# -pbp (because the -wbb list typo in the PBP book carried over to Perltidy (!))
# The following Perltidy options are not used, for other reasons:
# -sot, -mft, -cab, -bol, -bok/-nbok, -bot/-nbot, -iob, -isbc

</pre>
  </body>
</html>