From c752504c6f3513e5c6afb41869e4c1183658b342 Mon Sep 17 00:00:00 2001 From: Nigel Metheringham Date: Fri, 26 Oct 2012 21:26:22 +0100 Subject: [PATCH] Tidyall support --- .gitignore | 1 + .perltidyrc | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++ .tidyallrc | 13 ++++++++++++ script/gen.pl | 29 ++++++++++++-------------- 4 files changed, 83 insertions(+), 16 deletions(-) create mode 100644 .gitignore create mode 100644 .perltidyrc create mode 100644 .tidyallrc diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bfa5bf9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.tidyall.d diff --git a/.perltidyrc b/.perltidyrc new file mode 100644 index 0000000..7727996 --- /dev/null +++ b/.perltidyrc @@ -0,0 +1,56 @@ +--maximum-line-length=120 +##--trim-qw +#---------------- PBP options, as listed on page 35 of PBP ---------------- +##-l=78 # Max line width is 78 cols +-i=4 # Indent level is 4 cols +-ci=4 # Continuation indent is 4 cols +-vt=2 # Maximal vertical tightness +-cti=0 # No extra indentation for closing brackets +-pt=1 # Medium parenthesis tightness +-sbt=1 # Medium square bracket tightness +-bt=1 # Medium brace tightness (for non-code blocks) +-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=" +# Note that the PBP book has a typo on page 35 when defining the above -wbb +# option, see http://oreilly.com/catalog/perlbp/errata/perlbp.confirmed +# 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=0 # Don't try to line up all comments to a fixed column +-hsc # Align hanging side comments +-sbc # 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 +##-se # Write errors to STDERR +##-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 diff --git a/.tidyallrc b/.tidyallrc new file mode 100644 index 0000000..1e0d8ed --- /dev/null +++ b/.tidyallrc @@ -0,0 +1,13 @@ +[PerlTidy] +argv = --profile=$ROOT/.perltidyrc +select = **/*.{pl,pm,t} + +[PodTidy] +select = **/*.{pl,pm,pod} + +[PerlCritic] +select = **/*.{pl,pm} +except_modes = editor + +[Perl::AlignMooseAttributes] +select = **/*.{pl,pm,t} diff --git a/script/gen.pl b/script/gen.pl index c223db5..1a5f6ac 100755 --- a/script/gen.pl +++ b/script/gen.pl @@ -505,13 +505,12 @@ Display man page =item B<--spec> I -List of files that make up the specification documentation -docbook/XML source files. +List of files that make up the specification documentation docbook/XML source +files. =item B<--filter> I -List of files that make up the filter documentation docbook/XML -source files. +List of files that make up the filter documentation docbook/XML source files. =item B<--web> @@ -519,8 +518,8 @@ Generate the website from the template files. =item B<--latest> I -Specify the current exim version. This is used to create links to -the current documentation. +Specify the current exim version. This is used to create links to the current +documentation. This option is I @@ -532,24 +531,23 @@ This option is I =item B<--docroot> I -Specify the directory that the output should be generated into. -This is the website C directory. +Specify the directory that the output should be generated into. This is the +website C directory. This option is I =item B<--minify> -If this option is set then both the CSS and Javascript files -processed are minified using L and -L respectively. +If this option is set then both the CSS and Javascript files processed are +minified using L and L +respectively. This option is set by default - to disable it specify C<--no-minify> =item B<--localstatic> -Makes the static files (CSS, images etc), local for each version of -the documentation. This is more suitable for packaged HTML -documentation. +Makes the static files (CSS, images etc), local for each version of the +documentation. This is more suitable for packaged HTML documentation. =back @@ -571,8 +569,7 @@ Generates the exim website and HTML documentation. Mike Cardwell -Nigel Metheringham - mostly broke the framework -Mike produced. +Nigel Metheringham - mostly broke the framework Mike produced. =head1 COPYRIGHT -- 2.30.2