Skip to content

Commit

Permalink
Trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
shlomif committed Jan 31, 2014
1 parent 3998ede commit 72a690b
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 7 deletions.
1 change: 1 addition & 0 deletions Changes
@@ -1,6 +1,7 @@
0.05 Fri 31 Jan 19:35:34 IST 2014
- Minimum version of perl (CPANTS).
- Add a LICENSE file (CPANTS).
- Add t/style-trailing-space.t and remove trailing whitespace.

0.04 Mon 3 Jun 17:38:17 IDT 2013
- Add an explicit version to Term::Shell::OnScopeLeave.
Expand Down
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -16,3 +16,4 @@ t/01require.t
t/02default.t
t/03catchsmry.t
t/pod.t
t/style-trailing-space.t
4 changes: 2 additions & 2 deletions inc/Test/Run/Builder.pm
Expand Up @@ -54,7 +54,7 @@ sub do_test_run_tests
Test::Run::CmdLine::Iface->new(
{
'test_files' => [glob("t/*.t")],
}
}
# 'backend_params' => $self->_get_backend_params(),
);

Expand All @@ -63,7 +63,7 @@ sub do_test_run_tests

sub ACTION_tags
{
return
return
system(qw(
ctags -f tags --recurse --totals
--exclude=blib/** --exclude=t/lib/**
Expand Down
10 changes: 5 additions & 5 deletions lib/Term/Shell.pm
Expand Up @@ -54,7 +54,7 @@ sub new {
$attribs->{completion_function} = $completion_handler;
}
elsif ($o->{API}{readline} eq 'Term::ReadLine::Perl') {
$readline::rl_completion_function =
$readline::rl_completion_function =
$readline::rl_completion_function = $completion_handler;
}
$o->find_handlers;
Expand Down Expand Up @@ -217,7 +217,7 @@ sub page_internal {
else {
$instructions = "enter for more, or q to quit";
}

if ($lines_left > 0) {
local $| = 1;
my $l = "---line $current_line/$total_lines ($instructions)---";
Expand Down Expand Up @@ -601,14 +601,14 @@ sub line_parsed {
}
# We do not parse outside of strings
# elsif ($c eq '\\') {
# $arg = (defined($arg) ? $arg : '')
# $arg = (defined($arg) ? $arg : '')
# . $o->process_esc(substr($args,$i+1,1));
# $i++;
# }
elsif ($c =~ /\s/) {
push @args, $arg if defined $arg;
$arg = undef
}
}
else {
$arg .= substr($args,$i,1);
}
Expand Down Expand Up @@ -721,7 +721,7 @@ sub possible_actions {
my $action = shift;
my $type = shift;
my $casei = $o->{API}{case_ignore} ? '(?i)' : '';
my @keys = grep { $_ =~ /$casei^\Q$action\E/ }
my @keys = grep { $_ =~ /$casei^\Q$action\E/ }
grep { exists $o->{handlers}{$_}{$type} }
keys %{$o->{handlers}};
return @keys;
Expand Down
29 changes: 29 additions & 0 deletions t/style-trailing-space.t
@@ -0,0 +1,29 @@
#!/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)\z/,
},
);

# TEST
$finder->no_trailing_space(
"No trailing space was found."
);

0 comments on commit 72a690b

Please sign in to comment.