[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.13-6-gc796bc1



The following commit has been merged in the master branch:
commit c796bc19f13f7250c1434fdf5898000bef7df7bf
Author: Niels Thykier <niels@thykier.net>
Date:   Sat Jun 1 15:53:44 2013 +0200

    lib: Add explicit return statements
    
    Add explicit return statements to subs.  Subs without a "well defined"
    return value or where the return value is not used, a simple "return;"
    was added.
    
    Exceptions include {,l,r}strip, which explicitly behave differently in
    void context (and thus a return for that does not really matter).
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/lib/Lintian/Architecture.pm b/lib/Lintian/Architecture.pm
index ad4dd53..cca72ad 100644
--- a/lib/Lintian/Architecture.pm
+++ b/lib/Lintian/Architecture.pm
@@ -130,6 +130,7 @@ sub _parse_arch {
         $ALT_ARCH_NAMES{$short} = $archstr;
         $ALT_ARCH_NAMES{$long} = $archstr;
     }
+    return 1;
 }
 
 my $ARCH_RAW = Lintian::Data->new ('common/architectures', qr/\s*+\Q||\E\s*+/o,
diff --git a/lib/Lintian/Check.pm b/lib/Lintian/Check.pm
index 50cedc6..928fa67 100644
--- a/lib/Lintian/Check.pm
+++ b/lib/Lintian/Check.pm
@@ -208,11 +208,12 @@ sub check_maintainer {
             }
         }
     }
+    return;
 }
 
 sub _tag {
     my @args = grep { defined($_) } @_;
-    tag(@args);
+    return tag(@args);
 }
 
 =item check_spelling(TAG, TEXT, FILENAME, EXCEPTION)
diff --git a/lib/Lintian/CollScript.pm b/lib/Lintian/CollScript.pm
index c38bc3d..a40b120 100644
--- a/lib/Lintian/CollScript.pm
+++ b/lib/Lintian/CollScript.pm
@@ -119,6 +119,7 @@ sub _parse_needs {
     $self->{'needs_info'}->{'min'} = \@min;
     $self->{'needs_info'}->{'type'} = \%typespec;
     $self->{'needs_info'}->{'max'} = \@max;
+    return;
 }
 
 =back
@@ -243,6 +244,7 @@ sub collect {
     } else {
         fail "Unknown interface: $iface";
     }
+    return;
 }
 
 sub _load_collector {
@@ -265,6 +267,7 @@ sub _load_collector {
     fail $self->name . ' does not have a collect function'
         unless defined $collector;
     $self->{'_collect_sub'} = $collector;
+    return;
 }
 
 =back
diff --git a/lib/Lintian/Data.pm b/lib/Lintian/Data.pm
index 021ba8a..38972f4 100644
--- a/lib/Lintian/Data.pm
+++ b/lib/Lintian/Data.pm
@@ -72,6 +72,7 @@ sub new {
             $data{$type} = $dataset;
         }
         $self->{'data'} = $data{$type};
+        return;
     }
 }
 
@@ -81,6 +82,7 @@ sub new {
     sub set_vendor {
         my (undef, $vendor) = @_;
         $profile = $vendor;
+        return;
     }
 
     # Returns a listref of profile names
@@ -173,13 +175,15 @@ sub _parse_file {
         }
         $dataset->{$key} = $val;
     }
+    return;
 }
 
 sub _force_promise {
     my ($self) = @_;
     my $promise = $self->{promise};
     $self->_load_data (@$promise);
-    delete $self->{promise}
+    delete $self->{promise};
+    return;
 }
 
 # Query a data object for whether a particular keyword is valid.
diff --git a/lib/Lintian/DepMap.pm b/lib/Lintian/DepMap.pm
index 5fb882a..dfc38a7 100644
--- a/lib/Lintian/DepMap.pm
+++ b/lib/Lintian/DepMap.pm
@@ -157,7 +157,8 @@ sub add {
         $self->{'map'}{$node} = $self->{'nodes'}{$node};
     } elsif (exists $self->{'map'}{$node}) {
         delete $self->{'map'}{$node};
-    } else { 1; }
+    }
+    return 1;
 }
 
 =item addp(node[, prefix, dependency[, dependency[, ...]]])
@@ -237,6 +238,7 @@ sub satisfy {
 
     delete $self->{'map'}{$node};
     delete $self->{'nodes'}{$node};
+    return 1;
 }
 
 =item done(node)
@@ -420,6 +422,7 @@ sub selectAll {
     for my $node ($self->selectable()) {
         $self->select($node);
     }
+    return;
 }
 
 =item parents(node)
diff --git a/lib/Lintian/Internal/FrontendUtil.pm b/lib/Lintian/Internal/FrontendUtil.pm
index 4d91c2f..e9093be 100644
--- a/lib/Lintian/Internal/FrontendUtil.pm
+++ b/lib/Lintian/Internal/FrontendUtil.pm
@@ -60,6 +60,7 @@ sub load_collections {
     }
 
     closedir($dir);
+    return;
 }
 
 # Return the default number of parallization to be used
diff --git a/lib/Lintian/Lab.pm b/lib/Lintian/Lab.pm
index 99ee656..e85094b 100644
--- a/lib/Lintian/Lab.pm
+++ b/lib/Lintian/Lab.pm
@@ -448,6 +448,7 @@ sub visit_packages {
         };
         $index->visit_all ($intv);
     }
+    return;
 }
 
 
@@ -836,6 +837,7 @@ sub _write_manifests {
         $plist->write_list ("$dir/info/${pkg_type}-packages")
             if $plist->dirty and exists $SUPPORTED_TYPES{$plist->type};
     }
+    return;
 }
 
 =item remove
@@ -924,6 +926,7 @@ sub _entry_removed {
     my $pkg_type = $entry->pkg_type;
     my $pf = $self->_get_lab_index ($pkg_type);
     $pf->delete ($entry);
+    return;
 }
 
 # event - triggered by Lintian::Lab::Entry
@@ -933,6 +936,7 @@ sub _entry_created {
     my $pf = $self->_get_lab_index ($pkg_type);
     $self->_new_entry ($entry) unless $pf->get ($entry);
     $pf->set_transient_marker (0, $entry);
+    return;
 }
 
 sub _new_entry {
@@ -1001,6 +1005,7 @@ sub _new_entry {
 
     $pf->set (\%data);
     $pf->set_transient_marker (1, $entry);
+    return;
 }
 
 =back
diff --git a/lib/Lintian/Lab/Entry.pm b/lib/Lintian/Lab/Entry.pm
index 712da12..ab2b364 100644
--- a/lib/Lintian/Lab/Entry.pm
+++ b/lib/Lintian/Lab/Entry.pm
@@ -213,6 +213,7 @@ Overrides clear_cache from L<Lintian::Processable>.
 sub clear_cache {
     my ($self) = @_;
     delete $self->{info};
+    return;
 }
 
 =item remove
@@ -460,6 +461,7 @@ sub _init {
         my ($cname, $cver) = split m/\s*=\s*/, $c;
         $self->_mark_coll_finished ($cname, $cver);
     }
+    return;
 }
 
 =back
diff --git a/lib/Lintian/Lab/Manifest.pm b/lib/Lintian/Lab/Manifest.pm
index ade8648..63aca88 100644
--- a/lib/Lintian/Lab/Manifest.pm
+++ b/lib/Lintian/Lab/Manifest.pm
@@ -305,6 +305,7 @@ sub visit_all {
     }
 
     $self->_recurse_visit ($root, $visitor, scalar @$qf - 1, @keys);
+    return;
 }
 
 =item get (KEYS...)
@@ -390,6 +391,7 @@ sub set_transient_marker {
     return unless $entry;
     $self->{'_transient'} = 1 if $marker;
     delete $self->{'_transient'} unless $marker;
+    return;
 }
 
 =item delete (KEYS...)
@@ -515,6 +517,7 @@ sub diff {
 sub _mark_dirty {
     my ($self, $dirty) = @_;
     $self->{'dirty'} = $dirty;
+    return;
 }
 
 # $plist->_do_read_file($file, $header, $fields)
@@ -581,6 +584,7 @@ sub _make_alias_fields {
         $id .= '/' . $entry->{'architecture'} if $self->type ne 'source';
         $entry->{'identifier'} = $id;
     }
+    return;
 }
 
 sub _do_get {
@@ -671,6 +675,7 @@ sub _recurse_visit {
         # ... or is it the value to be visited?
         $visitor->($v, @keys, $k) if $visit;
     }
+    return;
 }
 
 =back
diff --git a/lib/Lintian/Output.pm b/lib/Lintian/Output.pm
index 30340eb..8e4c6a6 100644
--- a/lib/Lintian/Output.pm
+++ b/lib/Lintian/Output.pm
@@ -185,6 +185,7 @@ sub msg {
 
     return if $self->verbosity_level < 0;
     $self->_message(@args);
+    return;
 }
 
 sub v_msg {
@@ -192,6 +193,7 @@ sub v_msg {
 
     return unless $self->verbosity_level > 0;
     $self->_message(@args);
+    return;
 }
 
 sub debug_msg {
@@ -200,6 +202,7 @@ sub debug_msg {
     return unless $self->debug && ($self->debug >= $level);
 
     $self->_message(@args);
+    return;
 }
 
 =item C<warning(@args)>
@@ -214,6 +217,7 @@ sub warning {
 
     return if $self->verbosity_level < 0;
     $self->_warning(@args);
+    return;
 }
 
 =item C<delimiter()>
@@ -327,6 +331,7 @@ sub print_tag {
         $self->_print('', 'N', split("\n", $description));
         $self->_print('', 'N', '');
     }
+    return;
 }
 
 # Helper function to "print_tag" to decide the output format of the tag line.  Used by
@@ -360,6 +365,7 @@ sub print_start_pkg {
 
     $self->v_msg($self->delimiter,
                  "Processing $pkg_info->{type} $object $pkg_info->{package} (version $pkg_info->{version}, arch $pkg_info->{arch}) ...");
+    return;
 }
 
 =item C<print_start_pkg($pkg_info)>
@@ -371,6 +377,7 @@ Lintian::Tags::file_end().
 =cut
 
 sub print_end_pkg {
+    return;
 }
 
 =back
@@ -400,6 +407,7 @@ sub _message {
     my ($self, @args) = @_;
 
     $self->_print('', 'N', @args);
+    return;
 }
 
 =item C<_warning(@args)>
@@ -412,6 +420,7 @@ sub _warning {
     my ($self, @args) = @_;
 
     $self->_print($self->stderr, 'warning', @args);
+    return;
 }
 
 =item C<_print($stream, $lead, @args)>
@@ -435,6 +444,7 @@ sub _print {
 
     my $output = $self->string($lead, @args);
     print {$stream} $output;
+    return;
 }
 
 =item C<_delimiter()>
diff --git a/lib/Lintian/Output/ColonSeparated.pm b/lib/Lintian/Output/ColonSeparated.pm
index 9e4eda6..5a8d58e 100644
--- a/lib/Lintian/Output/ColonSeparated.pm
+++ b/lib/Lintian/Output/ColonSeparated.pm
@@ -47,6 +47,7 @@ sub print_tag {
         $self->_quote_print ($information),
         $odata,
         );
+    return;
 }
 
 sub _delimiter {
@@ -59,6 +60,7 @@ sub _message {
     foreach (@args) {
         $self->_print('message', $_);
     }
+    return;
 }
 
 sub _warning {
@@ -67,6 +69,7 @@ sub _warning {
     foreach (@args) {
         $self->_print('warning', $_);
     }
+    return;
 }
 
 sub _print {
@@ -74,6 +77,7 @@ sub _print {
 
     my $output = $self->string(@args);
     print {$self->stdout} $output;
+    return;
 }
 
 sub string {
diff --git a/lib/Lintian/Output/LetterQualifier.pm b/lib/Lintian/Output/LetterQualifier.pm
index 45f4c80..89b87f9 100644
--- a/lib/Lintian/Output/LetterQualifier.pm
+++ b/lib/Lintian/Output/LetterQualifier.pm
@@ -133,6 +133,7 @@ sub print_tag {
         $self->_print('', 'N', split("\n", $description));
         $self->_print('', 'N', '');
     }
+    return;
 }
 
 1;
diff --git a/lib/Lintian/Output/XML.pm b/lib/Lintian/Output/XML.pm
index 4aeb467..c21420a 100644
--- a/lib/Lintian/Output/XML.pm
+++ b/lib/Lintian/Output/XML.pm
@@ -45,6 +45,7 @@ sub print_tag {
                  [ flags     => $flags ],
                  [ name      => $tag_info->tag ]);
     print { $self->stdout } $self->_make_xml_tag('tag', \@attrs, $self->_quote_print ($information), $comment), "\n";
+    return;
 }
 
 sub print_start_pkg {
@@ -54,11 +55,13 @@ sub print_start_pkg {
                  [ architecture => $pkg_info->{arch} ],
                  [ version      => $pkg_info->{version} ]);
     print { $self->stdout } $self->_open_xml_tag('package', \@attrs, 0), "\n";
+    return;
 }
 
 sub print_end_pkg {
     my ($self) = @_;
-    print { $self->stdout } "</package>\n"
+    print { $self->stdout } "</package>\n";
+    return;
 }
 
 sub _delimiter {
@@ -70,6 +73,7 @@ sub _print {
     $stream ||= $self->stderr;
     my $output = $self->string($lead, @args);
     print { $stream } $output;
+    return;
 }
 
 # Create a start tag (or a self-closed tag)
diff --git a/lib/Lintian/Processable.pm b/lib/Lintian/Processable.pm
index 10ab924..7beef27 100644
--- a/lib/Lintian/Processable.pm
+++ b/lib/Lintian/Processable.pm
@@ -181,6 +181,7 @@ sub _make_identifier {
         $id .= "/$pkg_arch";
     }
     $self->{identifier} = $id;
+    return;
 }
 
 
@@ -268,7 +269,7 @@ overridden by sub-classes.
 =cut
 
 sub clear_cache {
-    my ($self) = @_;
+    return;
 }
 
 
diff --git a/lib/Lintian/Processable/Package.pm b/lib/Lintian/Processable/Package.pm
index 9276ce4..953ecf2 100644
--- a/lib/Lintian/Processable/Package.pm
+++ b/lib/Lintian/Processable/Package.pm
@@ -248,6 +248,7 @@ sub clear_cache {
     my $lpkg = $self->lab_pkg;
     $lpkg->clear_cache if defined $lpkg;
     delete $self->{info};
+    return;
 }
 
 =back
diff --git a/lib/Lintian/ProcessableGroup.pm b/lib/Lintian/ProcessableGroup.pm
index 9d41eed..9a3f6f7 100644
--- a/lib/Lintian/ProcessableGroup.pm
+++ b/lib/Lintian/ProcessableGroup.pm
@@ -320,6 +320,7 @@ Mostly useful when checking a lot of packages (e.g. on lintian.d.o).
 sub clear_cache {
     my ($self) = @_;
     delete $self->{info};
+    return;
 }
 
 =back
diff --git a/lib/Lintian/Profile.pm b/lib/Lintian/Profile.pm
index 5183f0e..1a3519c 100644
--- a/lib/Lintian/Profile.pm
+++ b/lib/Lintian/Profile.pm
@@ -253,6 +253,7 @@ sub enable_tags {
         $self->{'enabled-tags'}->{$tag} = 1;
         $self->{'enabled-checks'}->{$ti->script}++;
     }
+    return;
 }
 
 =item $prof->disable_tags (@tags)
@@ -271,6 +272,7 @@ sub disable_tags {
         delete $self->{'enabled-checks'}->{$ti->script}
             unless --$self->{'enabled-checks'}->{$ti->script};
     }
+    return;
 }
 
 =item $prof->include_path ([$path])
@@ -377,6 +379,7 @@ sub _read_profile {
             $self->_read_profile_section($pname, $psection, $i++);
         }
     }
+    return;
 }
 
 
@@ -409,6 +412,7 @@ sub _read_profile_section {
             }
         }
     }
+    return;
 }
 
 # $self->_read_profile_tags($pname, $pheader)
@@ -452,6 +456,7 @@ sub _read_profile_tags{
     $self->_enable_tags_from_field($pname, $pheader, 'disable-tags-from-check', $tags_from_check_sub, 0);
     $self->_enable_tags_from_field($pname, $pheader, 'enable-tags', $tag_sub, 1);
     $self->_enable_tags_from_field($pname, $pheader, 'disable-tags', $tag_sub, 0);
+    return;
 }
 
 # $self->_enable_tags_from_field($pname, $pheader, $field, $code, $enable)
@@ -467,6 +472,7 @@ sub _enable_tags_from_field {
     return unless $pheader->{$field};
     @tags = map { $code->($field, $_) } $self->_split_comma_sep_field($pheader->{$field});
     $self->$method (@tags);
+    return;
 }
 
 
@@ -494,6 +500,7 @@ sub _check_duplicates{
             $dupmap{$element} = $field;
         }
     }
+    return;
 }
 
 # $self->_parse_boolean($bool, $def, $pname, $sno);
@@ -532,6 +539,7 @@ sub _check_for_invalid_fields {
         next if exists $known->{$field};
         croak "Unknown field \"$field\" in $pname ($paraname)";
     }
+    return;
 }
 
 sub _load_check {
@@ -545,7 +553,7 @@ sub _load_check {
         }
     }
     croak "$profile references unknown $check" unless defined $dir;
-    $self->_parse_check ($check, $dir);
+    return $self->_parse_check ($check, $dir);
 }
 
 sub _parse_check {
@@ -590,6 +598,7 @@ sub _load_checks {
         }
         closedir($dirfd);
     }
+    return;
 }
 
 sub _default_inc_path {
diff --git a/lib/Lintian/Relation.pm b/lib/Lintian/Relation.pm
index e944f0f..22035fa 100644
--- a/lib/Lintian/Relation.pm
+++ b/lib/Lintian/Relation.pm
@@ -860,6 +860,7 @@ predicates).
 sub empty {
     my ($self) = @_;
     return 1 if $self->[0] eq 'AND' and not $self->[1];
+    return 0;
 }
 
 =back
diff --git a/lib/Lintian/Tag/Info.pm b/lib/Lintian/Tag/Info.pm
index 72b2d2d..0338a7d 100644
--- a/lib/Lintian/Tag/Info.pm
+++ b/lib/Lintian/Tag/Info.pm
@@ -317,6 +317,7 @@ sub set_severity{
     my ($self, $sev) = @_;
     croak "Unknown severity $sev.\n" unless exists $CODES{$sev};
     $self->{'effective-severity'} = $sev;
+    return;
 }
 
 =item script()
diff --git a/lib/Lintian/Tag/Override.pm b/lib/Lintian/Tag/Override.pm
index bf4b75b..9432faf 100644
--- a/lib/Lintian/Tag/Override.pm
+++ b/lib/Lintian/Tag/Override.pm
@@ -163,6 +163,7 @@ sub _init  {
     } else {
         $self->{'is_pattern'} = 0;
     }
+    return;
 }
 
 =back
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index 255a66f..57c3414 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -227,6 +227,7 @@ sub _record_stats {
     $stats->{severity}{$info->severity}++;
     $stats->{certainty}{$info->certainty}++;
     $stats->{types}{$code}++;
+    return;
 }
 
 sub tag {
@@ -260,6 +261,7 @@ sub tag {
     return unless $self->displayed($tag);
     my $file = $self->{info}{$self->{current}};
     $Lintian::Output::GLOBAL->print_tag($file, $info, $extra, $override);
+    return;
 }
 
 =back
@@ -377,6 +379,7 @@ sub display {
             $self->{display_level}{$s}{$c} = $status;
         }
     }
+    return;
 }
 
 =item show_experimental(BOOL)
@@ -389,6 +392,7 @@ false, configure experimental tags to not be shown.
 sub show_experimental {
     my ($self, $bool) = @_;
     $self->{show_experimental} = $bool ? 1 : 0;
+    return;
 }
 
 =item show_overrides(BOOL)
@@ -401,6 +405,7 @@ configure overridden tags to not be shown.
 sub show_overrides {
     my ($self, $bool) = @_;
     $self->{show_overrides} = $bool ? 1 : 0;
+    return;
 }
 
 =item sources([SOURCE [, ...]])
@@ -418,6 +423,7 @@ sub sources {
     for my $source (@sources) {
         $self->{display_source}{$source} = 1;
     }
+    return;
 }
 
 =item profile(PROFILE)
@@ -431,6 +437,7 @@ non-overridable.
 sub profile {
     my ($self, $profile) = @_;
     $self->{profile} = $profile;
+    return;
 }
 
 =back
@@ -481,6 +488,7 @@ sub file_start {
     }
     $self->{current} = $file;
     $Lintian::Output::GLOBAL->print_start_pkg($self->{info}{$file});
+    return;
 }
 
 =item file_overrides(OVERRIDE-FILE)
@@ -636,6 +644,7 @@ sub file_overrides {
         }
     }
     close($file);
+    return;
 }
 
 =item file_end()
@@ -652,6 +661,7 @@ sub file_end {
         $Lintian::Output::GLOBAL->print_end_pkg($info);
     }
     undef $self->{current};
+    return;
 }
 
 =back
diff --git a/lib/Lintian/Unpacker.pm b/lib/Lintian/Unpacker.pm
index c4aad11..9e75cf4 100644
--- a/lib/Lintian/Unpacker.pm
+++ b/lib/Lintian/Unpacker.pm
@@ -541,6 +541,7 @@ sub process_tasks {
                 if $finish_hook;
         }
     }
+    return;
 }
 
 =item reset_worklist
@@ -553,7 +554,8 @@ current worklist.
 sub reset_worklist {
     my ($self) = @_;
     $self->wait_for_jobs;
-    $self->{'worktable'} = {}
+    $self->{'worktable'} = {};
+    return;
 }
 
 =item wait_for_jobs
@@ -572,6 +574,7 @@ sub wait_for_jobs {
         }
         $self->{'running-jobs'} = {}
     }
+    return;
 }
 
 =item kill_jobs
@@ -587,8 +590,9 @@ sub kill_jobs {
     if (%{ $running }) {
         kill_all ($running);
         kill_all ($running, 'KILL') if %$running;
-        $self->{'running-jobs'} = {}
+        $self->{'running-jobs'} = {};
     }
+    return;
 }
 
 =item jobs
diff --git a/lib/Lintian/Util.pm b/lib/Lintian/Util.pm
index 3c06a65..f1945c5 100644
--- a/lib/Lintian/Util.pm
+++ b/lib/Lintian/Util.pm
@@ -794,6 +794,7 @@ sub clean_env {
     if ($cloc) {
         $ENV{LC_ALL} = 'C';
     }
+    return;
 }
 
 =item perm2oct(PERM)
@@ -878,7 +879,8 @@ sub copy_dir {
 =item gunzip_file (IN, OUT)
 
 Decompresses contents of the file IN and stores the contents in the
-file OUT.  IN is I<not> removed by this call.
+file OUT.  IN is I<not> removed by this call.  On error, this function
+will cause a trappable error.
 
 =cut
 
@@ -886,6 +888,7 @@ sub gunzip_file {
     my ($in, $out) = @_;
     spawn({out => $out, fail => 'error'},
           ['gzip', '-dc', $in]);
+    return;
 }
 
 
@@ -1039,39 +1042,39 @@ Like L<strip|/strip ([LINE])> but only strip trailing whitespace.
 =cut
 
 # prototype for default to $_
-sub strip (_) {
+sub strip (_) { ## no critic (Subroutines::RequireFinalReturn)
     if (defined wantarray) {
         # perl 5.14 s///r would have been useful here.
         my ($arg) = @_;
         $arg =~ s/^\s++|\s++$//g;
         return $arg;
-    } else {
-        $_[0] =~ s/^\s++|\s++$//g;
     }
+    $_[0] =~ s/^\s++|\s++$//g;
+    # void context, so no return needed here.
 }
 
 # prototype for default to $_
-sub lstrip (_) {
+sub lstrip (_) { ## no critic (Subroutines::RequireFinalReturn)
     if (defined wantarray) {
         # perl 5.14 s///r would have been useful here.
         my ($arg) = @_;
         $arg =~ s/^\s++//;
         return $arg;
-    } else {
-        $_[0] =~ s/^\s++//;
     }
+    $_[0] =~ s/^\s++//;
+    # void context, so no return needed here.
 }
 
 # prototype for default to $_
-sub rstrip (_) {
+sub rstrip (_) {  ## no critic (Subroutines::RequireFinalReturn)
     if (defined wantarray) {
         # perl 5.14 s///r would have been useful here.
         my ($arg) = @_;
         $arg =~ s/\s++$//g;
         return $arg;
-    } else {
-        $_[0] =~ s/\s++$//;
     }
+    $_[0] =~ s/\s++$//;
+    # void context, so no return needed here.
 }
 
 =item check_path (CMD)
diff --git a/lib/Test/Lintian.pm b/lib/Test/Lintian.pm
index 14850c9..f614673 100644
--- a/lib/Test/Lintian.pm
+++ b/lib/Test/Lintian.pm
@@ -262,6 +262,7 @@ sub test_check_desc {
 
     $builder->cmp_ok ($tested, '>', 0, 'Tested at least one desc file')
         if @descs;
+    return;
 }
 
 =item test_load_profiles(ROOT, INC...)
@@ -310,6 +311,7 @@ sub test_load_profiles {
     };
 
     File::Find::find (\%opt, $absdir);
+    return;
 }
 
 =item test_load_checks([OPTS, ]DIR[, CHECKNAMES...])
@@ -423,6 +425,7 @@ sub test_load_checks {
             $builder->diag ("Error: $err\n") if $err;
         }
     }
+    return;
 }
 
 =item test_tags_implemented ([OPTS, ]DIR[, CHECKNAMES...])
@@ -566,6 +569,7 @@ sub test_tags_implemented {
         $builder->is_eq (join (', ', @missing), '',
                          "$cname has all tags implemented");
     }
+    return;
 }
 
 =item load_profile_for_test ([PROFNAME[, INC...]])
@@ -614,6 +618,7 @@ sub load_profile_for_test {
     Lintian::Data->set_vendor ($PROFILE);
     $ENV{'LINTIAN_HELPER_DIRS'} = join(':', map { "$_/helpers" } @inc);
     $ENV{'LINTIAN_INCLUDE_DIRS'} = join(':', @inc);
+    return;
 }
 
 

-- 
Debian package checker


Reply to: