[libcode-tidyall-perl] 23/374: add pod to plugins

Jonas Smedegaard js at alioth.debian.org
Sun Sep 29 22:25:42 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libcode-tidyall-perl.

commit b29e601dd7222633776f15a7073af1f0dd5003cd
Author: Jonathan Swartz <swartz at pobox.com>
Date:   Fri Jun 15 21:10:08 2012 -0500

    add pod to plugins
---
 bin/tidyall                           |   56 ++++++++++++++++++++++++---------
 lib/Code/TidyAll/Plugin/PerlTidy.pm   |   45 +++++++++++++++++++++++++-
 lib/Code/TidyAll/Plugin/PodTidy.pm    |   26 +++++++++++++++
 lib/Code/TidyAll/Plugin/perlcritic.pm |   34 ++++++++++++++++++++
 4 files changed, 145 insertions(+), 16 deletions(-)

diff --git a/bin/tidyall b/bin/tidyall
index 4a781b8..2fb9948 100755
--- a/bin/tidyall
+++ b/bin/tidyall
@@ -64,6 +64,7 @@ tidyall - Your all-in-one code tidier and validator
 =head1 SYNOPSIS
 
     # Create a tidyall.ini at the top of your project
+    #
     [PerlTidy]
     argv = -noll -it=2
     select = **/*.{pl,pm,t}
@@ -73,10 +74,16 @@ tidyall - Your all-in-one code tidier and validator
     select = lib/**/*.pm
     ignore = lib/UtterHack.pm
 
-    # Process all files in the current project, look upwards from the cwd for tidyall.ini
+    # Process all files in the current project, look upwards from cwd for tidyall.ini
+    #
     % tidyall -a
 
+    # Process all files in a particular project
+    #
+    % tidyall -a --root-dir /home/joe/project
+
     # Process one or more specific files, look upwards from the first file for tidyall.ini
+    #
     % tidyall file [file...]
 
 =head1 OPTIONS
@@ -94,10 +101,10 @@ tidyall - Your all-in-one code tidier and validator
 There are a lot of great code tidiers and validators out there. C<tidyall>
 makes them available from a single unified interface.
 
-You can run C<tidyall> on a single file or an entire hierarchy of files, and
-configure which tidiers/validators are applied to which types of files.
-C<tidyall> will back up files beforehand, and for efficiency will only consider
-files that have changed since they were last processed.
+You can run C<tidyall> on a single file or on an entire project hierarchy,
+and configure which tidiers/validators are applied to which files.
+C<tidyall> will back up files beforehand, and for efficiency will only
+consider files that have changed since they were last processed.
 
 =head2 What's a tidier? What's a validator?
 
@@ -112,6 +119,13 @@ L<xmllint|http://xmlsoft.org/xmllint.html>.
 Many tidiers are also validators, e.g. C<perltidy> will throw an error on badly
 formed Perl.
 
+To use a tidier or validator with C<tidyall> it must have a corresponding
+plugin, usually under the prefix C<Code::TidyAll::Plugin::>.  This
+distribution comes with plugins for
+L<perltidy|Code::TidyAll::Plugin::PerlTidy>,
+C<perlcritic|Code::TidyAll::Plugin::PerlCritic> and
+C<podtidy|Code::TidyAll::Plugin::PodTidy>.
+
 =head1 USING TIDYALL
 
 C<tidyall> works on a project basis, where a project is just a directory
@@ -205,9 +219,16 @@ with a '+', e.g.
 
 =item select
 
-A L<File::Zglob|File::Zglob> pattern indicating which files to select. The
-pattern is relative to the root directory and should have no leading slash.
-Special characters are:
+A L<File::Zglob|File::Zglob> pattern indicating which files to select, e.g.
+
+    # All .pl and .pm files somewhere under bin, lib and t
+    select = {bin,lib,t}/**/*.p[lm]
+
+    # All .txt files anywhere in the project
+    select = **/*.txt
+
+The pattern is relative to the root directory and should have no leading
+slash.  Special characters are:
 
 =over
 
@@ -232,7 +253,7 @@ At the beginning of a component, matches a character except a period (.). Otherw
 
 Matches any one of the set.
 
-=item C<< {pm,pl} >>
+=item C<< {a,b,c} >>
 
 Matches any of the alternatives.
 
@@ -240,14 +261,19 @@ Matches any of the alternatives.
 
 =item ignore
 
-A L<File::Zglob|File::Zglob> pattern indicating which files to ignore.
-This overrides C<select>.
+A L<File::Zglob|File::Zglob> pattern, of the same format described above,
+indicating which files to ignore.  This overrides C<select>.
 
-=back
+=item argv
 
-=head1 OTHER FEATURES
+Many plugins (such as L<perltidy|Code::TidyAll::Plugin::PerlTidy>,
+C<perlcritic|Code::TidyAll::Plugin::PerlCritic> and
+C<podtidy|Code::TidyAll::Plugin::PodTidy>) take this option, which specifies
+arguments to pass to the underlying command-line utility.
+
+=back
 
-=head2 Last-processed cache
+=head1 LAST-PROCESSED CACHE
 
 C<tidyall> keeps track of each file's signature after it was last processed. On
 subsequent runs, it will only process a file if its signature has changed.
@@ -255,7 +281,7 @@ The cache is kept in files under the data dir.
 
 You can turn off this behavior with C<--no-cache>.
 
-=head2 Backups
+=head1 BACKUPS
 
 C<tidyall> will backup each file before modifying it. The timestamped backups
 are kept in a separate directory hierarchy under the data dir.
diff --git a/lib/Code/TidyAll/Plugin/PerlTidy.pm b/lib/Code/TidyAll/Plugin/PerlTidy.pm
index 8c9fe83..c86f077 100644
--- a/lib/Code/TidyAll/Plugin/PerlTidy.pm
+++ b/lib/Code/TidyAll/Plugin/PerlTidy.pm
@@ -14,7 +14,7 @@ sub process_source {
 
     # Determine parameters
     #
-    my %params = slice_exists( $self->options, qw(argv prefilter postfilter perltidyrc) );
+    my %params = slice_exists( $self->options, qw(argv prefilter postfilter) );
 
     no strict 'refs';
     &$perl_tidy_function(
@@ -28,3 +28,46 @@ sub process_source {
 }
 
 1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Code::TidyAll::Plugin::PerlTidy - use perltidy with tidyall
+
+=head1 SYNOPSIS
+
+   # In tidyall.ini:
+
+   # Configure in-line
+   #
+   [Perltidy]
+   argv = --noll
+   select = lib/**/*.pm
+
+   # or refer to a .perltidyrc in the same directory
+   #
+   [Perltidy]
+   argv = --profile=$ROOT/.perltidyrc
+   select = lib/**/*.pm
+
+=head1 OPTIONS
+
+=over
+
+=item argv
+
+Arguments to pass to C<perltidy>.
+
+=item perl_tidy_class
+
+Specify a C<Perl::Tidy> subclass to use instead of C<Perl::Tidy>.
+
+=item prefilter, postfilter
+
+Specify a prefilter and/or postfilter coderef. This can only be specified via
+the L<Code::TidyAll|Code::TidyAll> module API.
+
+=back
diff --git a/lib/Code/TidyAll/Plugin/PodTidy.pm b/lib/Code/TidyAll/Plugin/PodTidy.pm
index 72a55ea..02d1490 100644
--- a/lib/Code/TidyAll/Plugin/PodTidy.pm
+++ b/lib/Code/TidyAll/Plugin/PodTidy.pm
@@ -24,3 +24,29 @@ sub process_file {
 }
 
 1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Code::TidyAll::Plugin::PodTidy - use podtidy with tidyall
+
+=head1 SYNOPSIS
+
+   # In tidyall.ini:
+
+   [PodTidy]
+   argv = --column=90
+   select = lib/**/*.{pm,pod}
+
+=head1 OPTIONS
+
+=over
+
+=item argv
+
+Arguments to pass to podtidy.
+
+=back
diff --git a/lib/Code/TidyAll/Plugin/perlcritic.pm b/lib/Code/TidyAll/Plugin/perlcritic.pm
index 48e9987..d80806f 100644
--- a/lib/Code/TidyAll/Plugin/perlcritic.pm
+++ b/lib/Code/TidyAll/Plugin/perlcritic.pm
@@ -23,3 +23,37 @@ sub process_file {
 }
 
 1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Code::TidyAll::Plugin::PerlCritic - use perlcritic with tidyall
+
+=head1 SYNOPSIS
+
+   # In tidyall.ini:
+
+   # Configure in-line
+   #
+   [PerlCritic]
+   argv = --severity 5 --exclude=nowarnings
+   select = lib/**/*.pm
+
+   # or refer to a .perlcriticrc in the same directory
+   #
+   [PerlCritic]
+   argv = --profile $ROOT/.perlcriticrc
+   select = lib/**/*.pm
+
+=head1 OPTIONS
+
+=over
+
+=item argv
+
+Arguments to pass to perlcritic.
+
+=back

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libcode-tidyall-perl.git



More information about the Pkg-perl-cvs-commits mailing list