[dpkg] 39/192: test: Enable perlcritic Miscellanea::ProhibitTies

Ximin Luo infinity0 at debian.org
Tue Oct 17 11:03:56 UTC 2017


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

infinity0 pushed a commit to branch pu/reproducible_builds
in repository dpkg.

commit dd3cdbaf21841205a47d980a6678672973847d10
Author: Guillem Jover <guillem at debian.org>
Date:   Wed May 17 23:42:17 2017 +0200

    test: Enable perlcritic Miscellanea::ProhibitTies
---
 debian/changelog                       | 2 ++
 scripts/Dpkg/Compression/FileHandle.pm | 2 +-
 scripts/Dpkg/Control/HashCore.pm       | 2 +-
 t/critic.t                             | 1 +
 4 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 86e9404..d7dbd39 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -9,6 +9,8 @@ dpkg (1.19.0) UNRELEASED; urgency=medium
       available.
     - Do not override the default DEPENDENCIES for libdpkg, extend it instead.
     - Install perl man pages in section 3perl.
+  * Test suite:
+    - Enable perlcritic Miscellanea::ProhibitTies.
 
  -- Guillem Jover <guillem at debian.org>  Thu, 18 May 2017 05:27:31 +0200
 
diff --git a/scripts/Dpkg/Compression/FileHandle.pm b/scripts/Dpkg/Compression/FileHandle.pm
index dd9ae69..d7014e8 100644
--- a/scripts/Dpkg/Compression/FileHandle.pm
+++ b/scripts/Dpkg/Compression/FileHandle.pm
@@ -129,7 +129,7 @@ sub new {
     my $self = IO::File->new();
     # Tying is required to overload the open functions and to auto-open
     # the file on first read/write operation
-    tie *$self, $class, $self;
+    tie *$self, $class, $self; ## no critic (Miscellanea::ProhibitTies)
     bless $self, $class;
     # Initializations
     *$self->{compression} = 'auto';
diff --git a/scripts/Dpkg/Control/HashCore.pm b/scripts/Dpkg/Control/HashCore.pm
index 774974f..c4f025f 100644
--- a/scripts/Dpkg/Control/HashCore.pm
+++ b/scripts/Dpkg/Control/HashCore.pm
@@ -464,7 +464,7 @@ use parent -norequire, qw(Tie::ExtraHash);
 sub new {
     my $class = shift;
     my $hash = {};
-    tie %{$hash}, $class, @_;
+    tie %{$hash}, $class, @_; ## no critic (Miscellanea::ProhibitTies)
     return $hash;
 }
 
diff --git a/t/critic.t b/t/critic.t
index 14e27bd..d5eab8d 100644
--- a/t/critic.t
+++ b/t/critic.t
@@ -61,6 +61,7 @@ my @policies = qw(
     InputOutput::RequireCheckedOpen
     InputOutput::RequireEncodingWithUTF8Layer
     Miscellanea::ProhibitFormats
+    Miscellanea::ProhibitTies
     Miscellanea::ProhibitUnrestrictedNoCritic
     Miscellanea::ProhibitUselessNoCritic
     Modules::ProhibitConditionalUseStatements

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/dpkg.git



More information about the Reproducible-commits mailing list