From 9008da02456008bb6fa5b290ade29cfa53f667d2 Mon Sep 17 00:00:00 2001 From: Paul Howarth Date: Sat, 11 Jul 2020 18:26:45 +0100 Subject: [PATCH] Add workaround for 'Subroutine name is a homonym for builtin function isa' https://github.com/Perl-Critic/Perl-Critic/issues/911 https://bugzilla.redhat.com/show_bug.cgi?id=1852437 --- Perl-Critic-1.138-gh911.patch | 20 ++++++++++++++++++++ perl-Perl-Critic.spec | 12 +++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 Perl-Critic-1.138-gh911.patch diff --git a/Perl-Critic-1.138-gh911.patch b/Perl-Critic-1.138-gh911.patch new file mode 100644 index 0000000..b16a290 --- /dev/null +++ b/Perl-Critic-1.138-gh911.patch @@ -0,0 +1,20 @@ +This is a workaround for https://github.com/Perl-Critic/Perl-Critic/issues/911 + +This workaround causes no change in behaviour, but a long-term fix may include +making "isa" a special case like import, AUTOLOAD, and DESTROY, which are +commonly overridden. That would be a behaviour change. + +The "## no critic" pragma wouldn't be needed prior to Perl 5.32, hence the +additional reference to Miscellanea::ProhibitUselessNoCritic. + +--- lib/Perl/Critic/Document.pm ++++ lib/Perl/Critic/Document.pm +@@ -137,7 +137,7 @@ sub ppi_document { + + #----------------------------------------------------------------------------- + +-sub isa { ++sub isa { ## no critic (Subroutines::ProhibitBuiltinHomonyms, Miscellanea::ProhibitUselessNoCritic) + my ($self, @args) = @_; + return $self->SUPER::isa(@args) + || ( (ref $self) && $self->{_doc} && $self->{_doc}->isa(@args) ); diff --git a/perl-Perl-Critic.spec b/perl-Perl-Critic.spec index a0cc401..c746e55 100644 --- a/perl-Perl-Critic.spec +++ b/perl-Perl-Critic.spec @@ -7,13 +7,14 @@ Name: perl-Perl-Critic Version: 1.138 -Release: 4%{?dist} +Release: 5%{?dist} Summary: Critique Perl source code for best-practices License: GPL+ or Artistic URL: https://metacpan.org/release/Perl-Critic Source0: https://cpan.metacpan.org/modules/by-module/Perl/Perl-Critic-%{version}.tar.gz Patch0: 0001-Change-default-spell-check-tool-from-aspell-to-hunsp.patch Patch3: Perl-Critic-1.136-ppidump-shellbang.patch +Patch4: Perl-Critic-1.138-gh911.patch BuildArch: noarch # Build process @@ -132,6 +133,11 @@ of Perl code were mixed directly in the test script. That sucked. # Fix shellbang in ppidump tool %patch3 +# Workaround for 'Subroutine name is a homonym for builtin function isa' +# https://github.com/Perl-Critic/Perl-Critic/issues/911 +# https://bugzilla.redhat.com/show_bug.cgi?id=1852437 +%patch4 + # Drop exec bits from samples/docs to avoid dependency bloat find tools examples -type f -exec chmod -c -x {} ';' @@ -167,6 +173,10 @@ LC_ALL=en_US ./Build test %{_mandir}/man3/Test::Perl::Critic::Policy.3* %changelog +* Sat Jul 11 2020 Paul Howarth - 1.138-5 +- Add workaround for 'Subroutine name is a homonym for builtin function isa' + (#1852437, GH#911) + * Fri Jun 26 2020 Jitka Plesnikova - 1.138-4 - Perl 5.32 re-rebuild of bootstrapped packages