1. Shlomi Fish
  2. web-cpan

Commits

Shlomi Fish  committed d484610

Get rid of trailing space.

  • Participants
  • Parent commits 322b133
  • Branches default

Comments (0)

Files changed (9)

File Module-Format/Module-Format/Changes

View file
 Revision history for Module-Format
 
+        - Add t/style-trailing-space.t to check for trailing space.
+        - Get rid of trailing whitespace.
+
 0.0.4   Sat Jun 11 16:36:44 IDT 2011
         - Small improvement to the script/perlmf POD.
 
 0.0.3   Wed Dec  1 13:03:47 IST 2010
-        - Correct a bug with the regex of guessing a 
+        - Correct a bug with the regex of guessing a
         MooseX/Role/BuildInstanceOf.pm -like unix path.
 0.0.2   Sun Nov 28 22:13:26 IST 2010
         - Add keywords and resources to the Build.PL/META.yml.

File Module-Format/Module-Format/MANIFEST

View file
 t/perlmf-app.t
 t/pod-coverage.t
 t/pod.t
+t/style-trailing-space.t
 script/perlmf
 META.json

File Module-Format/Module-Format/README

View file
 Module-Format is a CPAN distribution to translate between the various formats
 that Perl 5 modules and distributions can appear in (e.g: "XML-RSS", "XML::RSS",
 "XML/RSS.pm", "perl(XML::RSS)", "perl-XML-RSS") and perform operations on
-a list of them. 
+a list of them.
 
 INSTALLATION
 

File Module-Format/Module-Format/inc/Test/Run/Builder.pm

View file
         Test::Run::CmdLine::Iface->new(
             {
                 'test_files' => [glob("t/*.t")],
-            }   
+            }
             # 'backend_params' => $self->_get_backend_params(),
         );
 
 
 sub ACTION_tags
 {
-    return 
+    return
         system(qw(
             ctags -f tags --recurse --totals
     		--exclude=blib/** --exclude=t/lib/**

File Module-Format/Module-Format/lib/Module/Format/Module.pm

View file
         );
 
     my $module = Module::Format::Module->from_guess(
-        { 
+        {
             value => # All of the above...
         }
     );
 
 =head2 my $module = Module::Format::Module->from_components({components => [@components]})
 
-Constructs a module from @components which are strings that indicate the 
+Constructs a module from @components which are strings that indicate the
 individual components of the module. For example:
 
     my $module = Module::Format::Module->from_components(
 
 Valid formats are:
 
-=over 4 
+=over 4
 
 =item * 'colon'
 
-Separated by a double colon, e.g: C<XML::RSS>, C<Data::Dumper>, 
+Separated by a double colon, e.g: C<XML::RSS>, C<Data::Dumper>,
 C<Catalyst::Plugin::Model::DBIx::Class>, etc.
 
 =item * 'dash'
 
-Separated by a double colon, e.g: C<XML-RSS>, C<Data-Dumper>, 
+Separated by a double colon, e.g: C<XML-RSS>, C<Data-Dumper>,
 C<Catalyst-Plugin-Model-DBIx-Class>, etc.
 
 =item * 'unix'
 =item * 'rpm_colon'
 
 Like colon only wrapped inside C<perl(...)> - useful for rpm provides for
-individual modules. E.g: C<perl(XML::RSS)>, 
+individual modules. E.g: C<perl(XML::RSS)>,
 C<perl(Catalyst::Plugin::Authentication)> .
 
 =item * 'debian'
     {
         name => 'colon',
         regex => qr{\A$colon_re\z},
-        input => sub { 
+        input => sub {
             my ($class, $value) = @_;
-            return [split(/::/, $value, -1)]; 
+            return [split(/::/, $value, -1)];
         },
         format => sub {
             my ($self) = @_;
     {
         name => 'dash',
         regex => qr{\A$dash_re\z},
-        input => sub { 
+        input => sub {
             my ($class, $value) = @_;
-            return [split(/-/, $value, -1)]; 
+            return [split(/-/, $value, -1)];
         },
         format => sub {
             my ($self) = @_;
 =head2 my $array_ref = $module->get_components_list()
 
 Returns the components list of the module as an array reference. For
-example for the module C<One::Two::Three> it would be 
+example for the module C<One::Two::Three> it would be
 C<["One", "Two", "Three"]>.
 
 =cut
     my $self = shift;
 
     return ref($self)->from_components(
-        {components => $self->get_components_list() } 
+        {components => $self->get_components_list() }
     );
 }
 
 
     # TODO : After the previous line the indentation in vim is reset to the
     # first column.
-    
+
     foreach my $format_record (@formats_by_priority)
     {
         if (my $regex = $format_record->{regex})

File Module-Format/Module-Format/lib/Module/Format/ModuleList.pm

View file
 
     foreach my $name (@{$list->format_as('rpm_colon')})
     {
-        print "$name\n";    
+        print "$name\n";
     }
 
     my $list = Module::Format::ModuleList->sane_from_guesses(
 
 =head2 my $list_obj = Module::Format::ModuleList->sane_from_guesses({values => \@list_of_strings});
 
-Initialises a module list object from a list of strings by using 
-L<Module::Format::Module>'s from_guess on each string and while checking the 
+Initialises a module list object from a list of strings by using
+L<Module::Format::Module>'s from_guess on each string and while checking the
 guesses for sanity. See the synposis for an example.
 
 =cut
         push @modules, $module;
     }
 
-    return $class->new({modules => \@modules});  
+    return $class->new({modules => \@modules});
 }
 
 =head1 AUTHOR

File Module-Format/Module-Format/t/module.t

View file
 
 {
     my $module = Module::Format::Module->from_guess({value => "XML::RSS"});
-    
+
     # TEST
     ok ($module, "from_guess initialises a module.");
 
             format_ref => \$chosen_format,
         }
     );
-    
+
     # TEST
     ok ($module, "from_guess initialises a module.");
 
             format_ref => \$chosen_format,
         }
     );
-    
+
     # TEST
     ok ($module, "from_guess initialises a module.");
 
             format_ref => \$chosen_format,
         }
     );
-    
+
     # TEST
     ok ($module, "from_guess initialises a module.");
 
             format_ref => \$chosen_format,
         }
     );
-    
+
     # TEST
     ok ($module, "from_guess initialises a module.");
 
             format_ref => \$chosen_format,
         }
     );
-    
+
     # TEST
     ok ($module, "from_guess initialises a module.");
 

File Module-Format/Module-Format/t/perlmf-app.t

View file
 
     # TEST
     is (
-        $trap->stdout(), 
+        $trap->stdout(),
         qq{perl(Data::Dump) perl(XML::Grammar::Fortune)\n},
         'as_rpm_colon works as expected.',
     );
 
     # TEST
     is (
-        $trap->stdout(), 
+        $trap->stdout(),
         qq{Data::Dump XML::Grammar::Fortune\n},
         'as_colon works as expected.',
     );
 
     # TEST
     is (
-        $trap->stdout(), 
+        $trap->stdout(),
         qq{libfoo-bar-baz-perl libquux-stanley-perl\n},
         'deb works as expected.',
     );
 
     # TEST
     is (
-        $trap->stdout(), 
+        $trap->stdout(),
         qq{perl(Data::Dump)\0perl(XML::Grammar::Fortune)},
         'as_rpm_colon -0 works as expected.',
     );
 
     # TEST
     is (
-        $trap->stdout(), 
+        $trap->stdout(),
         qq{perl(Data::Dump)\nperl(XML::Grammar::Fortune)\n},
         '-n works as expected.',
     );

File Module-Format/Module-Format/t/style-trailing-space.t

View file
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval "use Test::TrailingSpace";
+if ($@)
+{
+    plan skip_all => "Test::TrailingSpace required for trailing space test.";
+}
+else
+{
+    plan tests => 1;
+}
+
+my $finder = Test::TrailingSpace->new(
+    {
+        root => '.',
+        filename_regex => qr/(?:(?:\.(?:t|pm|pl|PL|yml|json|arc|vim))|README|Changes|LICENSE|MANIFEST)\z/,
+    },
+);
+
+# TEST
+$finder->no_trailing_space(
+    "No trailing space was found."
+);
+