[libcode-tidyall-perl] 190/374: put error message in Result::error, remove redundant msg
Jonas Smedegaard
js at alioth.debian.org
Sun Sep 29 22:26:17 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 dc1b7b3de8b48eec7ce2e1c9febae1fda92f979a
Author: Jonathan Swartz <swartz at pobox.com>
Date: Thu Sep 6 11:18:16 2012 -0700
put error message in Result::error, remove redundant msg
---
lib/Code/TidyAll.pm | 2 +-
lib/Code/TidyAll/Result.pm | 9 ++-------
lib/Code/TidyAll/SVN/Precommit.pm | 2 +-
lib/Test/Code/TidyAll.pm | 2 +-
4 files changed, 5 insertions(+), 10 deletions(-)
diff --git a/lib/Code/TidyAll.pm b/lib/Code/TidyAll.pm
index 55fc688..16c7719 100644
--- a/lib/Code/TidyAll.pm
+++ b/lib/Code/TidyAll.pm
@@ -247,7 +247,7 @@ sub process_source {
if ($error) {
$self->msg( "%s", $error );
- return Code::TidyAll::Result->new( path => $path, state => 'error', msg => $error );
+ return Code::TidyAll::Result->new( path => $path, state => 'error', error => $error );
}
elsif ($was_tidied) {
return Code::TidyAll::Result->new(
diff --git a/lib/Code/TidyAll/Result.pm b/lib/Code/TidyAll/Result.pm
index c8f678c..3259db2 100644
--- a/lib/Code/TidyAll/Result.pm
+++ b/lib/Code/TidyAll/Result.pm
@@ -1,12 +1,11 @@
package Code::TidyAll::Result;
use Moo;
-has 'msg' => ( is => 'ro' );
+has 'error' => ( is => 'ro' );
has 'new_contents' => ( is => 'ro' );
has 'path' => ( is => 'ro' );
has 'state' => ( is => 'ro' );
-sub error { return $_[0]->state eq 'error' }
sub ok { return $_[0]->state ne 'error' }
1;
@@ -64,13 +63,9 @@ A string, one of
Contains the new contents if state is 'tidied'
-=item msg
-
-Contains the error message if state is 'error'
-
=item error
-Returns true iff state is 'error'
+Contains the error message if state is 'error'
=item ok
diff --git a/lib/Code/TidyAll/SVN/Precommit.pm b/lib/Code/TidyAll/SVN/Precommit.pm
index a68cc0f..bd18347 100644
--- a/lib/Code/TidyAll/SVN/Precommit.pm
+++ b/lib/Code/TidyAll/SVN/Precommit.pm
@@ -102,7 +102,7 @@ sub check {
"%d file%s did not pass tidyall check",
$error_count, $error_count > 1 ? "s" : ""
),
- map { join( ": ", $_->path, $_->msg ) } @error_results
+ map { join( ": ", $_->path, $_->error ) } @error_results
);
}
}
diff --git a/lib/Test/Code/TidyAll.pm b/lib/Test/Code/TidyAll.pm
index 32ad697..a1d9f0d 100644
--- a/lib/Test/Code/TidyAll.pm
+++ b/lib/Test/Code/TidyAll.pm
@@ -23,7 +23,7 @@ sub tidyall_ok {
$test->ok( 1, $desc );
}
else {
- $test->diag( $result->msg );
+ $test->diag( $result->error );
$test->ok( 0, $desc );
}
}
--
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