From f8fed171abae4ebcb3c07c029fcfbbaaa30a55ce Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Oct 29 2019 10:20:42 +0000 Subject: import perl-Perl-Critic-More-1.000-9.el7 --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..35ba02f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/Perl-Critic-More-1.000.tar.gz diff --git a/.perl-Perl-Critic-More.metadata b/.perl-Perl-Critic-More.metadata new file mode 100644 index 0000000..a6875e0 --- /dev/null +++ b/.perl-Perl-Critic-More.metadata @@ -0,0 +1 @@ +a5525228e4241d95d770f49a0ae6d7a00e911707 SOURCES/Perl-Critic-More-1.000.tar.gz diff --git a/SOURCES/Perl-Critic-More-1.000-Miscellanea::RequireRcsKeywords.patch b/SOURCES/Perl-Critic-More-1.000-Miscellanea::RequireRcsKeywords.patch new file mode 100644 index 0000000..d266026 --- /dev/null +++ b/SOURCES/Perl-Critic-More-1.000-Miscellanea::RequireRcsKeywords.patch @@ -0,0 +1,236 @@ +--- Changes ++++ Changes +@@ -14,6 +14,8 @@ + Policy moved: + * ValuesAndExpressions::ProhibitMagicNumbers has been moved into the + core Perl::Critic distribution. ++ * Miscellanea::RequireRcsKeywords has been moved here from the core ++ Perl::Critic distribution (RT #69546). + + Dependencies: + * Now requires Perl::Critic 1.082. +--- lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm ++++ lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm +@@ -0,0 +1,202 @@ ++############################################################################## ++# $URL: http://perlcritic.tigris.org/svn/perlcritic/trunk/distributions/Perl-Critic/lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm $ ++# $Date: 2011-12-21 14:40:10 -0800 (Wed, 21 Dec 2011) $ ++# $Author: thaljef $ ++# $Revision: 4106 $ ++############################################################################## ++ ++package Perl::Critic::Policy::Miscellanea::RequireRcsKeywords; ++ ++use 5.006001; ++use strict; ++use warnings; ++use Readonly; ++ ++use List::MoreUtils qw(none); ++ ++use Perl::Critic::Utils qw{ ++ :booleans :characters :severities :data_conversion ++}; ++ ++use base 'Perl::Critic::Policy'; ++ ++our $VERSION = '1.000'; ++ ++#----------------------------------------------------------------------------- ++ ++Readonly::Scalar my $EXPL => [ 441 ]; ++ ++#----------------------------------------------------------------------------- ++ ++sub supported_parameters { ++ return ( ++ { ++ name => 'keywords', ++ description => 'The keywords to require in all files.', ++ default_string => $EMPTY, ++ behavior => 'string list', ++ }, ++ ); ++} ++ ++sub default_severity { return $SEVERITY_LOW } ++sub default_themes { return qw(core more pbp cosmetic) } ++sub applies_to { return 'PPI::Document' } ++ ++#----------------------------------------------------------------------------- ++ ++sub initialize_if_enabled { ++ my ($self, $config) = @_; ++ ++ # Any of these lists ++ $self->{_keyword_sets} = [ ++ ++ # Minimal svk/svn ++ [qw(Id)], ++ ++ # Expansive svk/svn ++ [qw(Revision HeadURL Date)], ++ ++ # cvs? ++ [qw(Revision Source Date)], ++ ]; ++ ++ # Set configuration, if defined. ++ my @keywords = keys %{ $self->{_keywords} }; ++ if ( @keywords ) { ++ $self->{_keyword_sets} = [ [ @keywords ] ]; ++ } ++ ++ return $TRUE; ++} ++ ++#----------------------------------------------------------------------------- ++ ++sub violates { ++ my ( $self, $elem, $doc ) = @_; ++ my @viols = (); ++ ++ my $nodes = $self->_find_wanted_nodes($doc); ++ for my $keywordset_ref ( @{ $self->{_keyword_sets} } ) { ++ if ( not $nodes ) { ++ my $desc = 'RCS keywords ' ++ . join( ', ', map {"\$$_\$"} @{$keywordset_ref} ) ++ . ' not found'; ++ push @viols, $self->violation( $desc, $EXPL, $doc ); ++ } ++ else { ++ my @missing_keywords = ++ grep ++ { ++ my $keyword_rx = qr< \$ $_ .* \$ >xms; ++ ! ! none { m/$keyword_rx/xms } @{$nodes} ++ } ++ @{$keywordset_ref}; ++ ++ if (@missing_keywords) { ++ # Provisionally flag a violation. See below. ++ my $desc = ++ 'RCS keywords ' ++ . join( ', ', map {"\$$_\$"} @missing_keywords ) ++ . ' not found'; ++ push @viols, $self->violation( $desc, $EXPL, $doc ); ++ } ++ else { ++ # Hey! I'm ignoring @viols for other keyword sets ++ # because this one is complete. ++ return; ++ } ++ } ++ } ++ ++ return @viols; ++} ++ ++#----------------------------------------------------------------------------- ++ ++sub _find_wanted_nodes { ++ my ( $self, $doc ) = @_; ++ my @wanted_types = qw(Pod Comment Quote::Single Quote::Literal End); ++ my @found = map { @{ $doc->find("PPI::Token::$_") || [] } } @wanted_types; ++ push @found, grep { $_->content() =~ m/ \A qw\$ [^\$]* \$ \z /smx } @{ ++ $doc->find('PPI::Token::QuoteLike::Words') || [] }; ++ return @found ? \@found : $EMPTY; # Behave like PPI::Node::find() ++} ++ ++1; ++ ++__END__ ++ ++#----------------------------------------------------------------------------- ++ ++=pod ++ ++=for stopwords RCS ++ ++=head1 NAME ++ ++Perl::Critic::Policy::Miscellanea::RequireRcsKeywords - Put source-control keywords in every file. ++ ++ ++=head1 AFFILIATION ++ ++This Policy is part of the core L ++distribution. ++ ++ ++=head1 DESCRIPTION ++ ++Every code file, no matter how small, should be kept in a ++source-control repository. Adding the magical RCS keywords to your ++file helps the reader know where the file comes from, in case he or ++she needs to modify it. This Policy scans your file for comments that ++look like this: ++ ++ # $Revision: 4106 $ ++ # $Source: /myproject/lib/foo.pm $ ++ ++A common practice is to use the C keyword to automatically ++define the C<$VERSION> variable like this: ++ ++ our ($VERSION) = '$Revision: 4106 $' =~ m{ \$Revision: \s+ (\S+) }x; ++ ++ ++=head1 CONFIGURATION ++ ++By default, this policy only requires the C, C, and ++C keywords. To specify alternate keywords, specify a value for ++C of a whitespace delimited series of keywords (without the ++dollar-signs). This would look something like the following in a ++F<.perlcriticrc> file: ++ ++ [Miscellanea::RequireRcsKeywords] ++ keywords = Revision Source Date Author Id ++ ++See the documentation on RCS for a list of supported keywords. Many ++source control systems are descended from RCS, so the keywords ++supported by CVS and Subversion are probably the same. ++ ++ ++=head1 AUTHOR ++ ++Jeffrey Ryan Thalhammer ++ ++ ++=head1 COPYRIGHT ++ ++Copyright (c) 2005-2011 Imaginative Software Systems. All rights reserved. ++ ++This program is free software; you can redistribute it and/or modify ++it under the same terms as Perl itself. The full text of this license ++can be found in the LICENSE file included with this module. ++ ++=cut ++ ++# Local Variables: ++# mode: cperl ++# cperl-indent-level: 4 ++# fill-column: 78 ++# indent-tabs-mode: nil ++# c-indentation-style: bsd ++# End: ++# ex: set ts=8 sts=4 sw=4 tw=78 ft=perl expandtab shiftround : +--- MANIFEST ++++ MANIFEST +@@ -4,6 +4,7 @@ lib/Perl/Critic/More.pm + lib/Perl/Critic/Policy/CodeLayout/RequireASCII.pm + lib/Perl/Critic/Policy/Editor/RequireEmacsFileVariables.pm + lib/Perl/Critic/Policy/ErrorHandling/RequireUseOfExceptions.pm ++lib/Perl/Critic/Policy/Miscellanea/RequireRcsKeywords.pm + lib/Perl/Critic/Policy/Modules/PerlMinimumVersion.pm + lib/Perl/Critic/Policy/Modules/RequirePerlVersion.pm + lib/Perl/Critic/Policy/ValuesAndExpressions/RestrictLongStrings.pm +--- t/99_pod_coverage.t ++++ t/99_pod_coverage.t +@@ -49,6 +49,7 @@ sub get_trusted_methods { + applies_to + default_themes + default_severity ++ initialize_if_enabled + supported_parameters + ); + } diff --git a/SPECS/perl-Perl-Critic-More.spec b/SPECS/perl-Perl-Critic-More.spec new file mode 100644 index 0000000..7f60bb5 --- /dev/null +++ b/SPECS/perl-Perl-Critic-More.spec @@ -0,0 +1,90 @@ +Name: perl-Perl-Critic-More +Version: 1.000 +Release: 9%{?dist} +Summary: Supplemental policies for Perl::Critic +License: GPL+ or Artistic +Group: Development/Libraries +URL: http://search.cpan.org/dist/Perl-Critic-More/ +Source0: http://www.cpan.org/authors/id/E/EL/ELLIOTJS/Perl-Critic-More-%{version}.tar.gz +# Add Miscellanea::RequireRcsKeywords removed from Perl::Critic as intended +# by slow upstream, bug #839815, CPAN RT#69546 +Patch0: Perl-Critic-More-1.000-Miscellanea::RequireRcsKeywords.patch +BuildArch: noarch +BuildRequires: perl(Module::Build) +# Run-time: +BuildRequires: perl(base) +BuildRequires: perl(Carp) +BuildRequires: perl(List::MoreUtils) +BuildRequires: perl(Perl::Critic) >= 1.082 +BuildRequires: perl(Perl::Critic::Policy) +BuildRequires: perl(Perl::Critic::Utils) +BuildRequires: perl(Perl::MinimumVersion) >= 0.14 +BuildRequires: perl(Readonly) >= 1.03 +# Tests: +BuildRequires: perl(Perl::Critic::Config) +BuildRequires: perl(Perl::Critic::TestUtils) +BuildRequires: perl(Perl::Critic::Violation) +BuildRequires: perl(Test::More) +# Optional test: +BuildRequires: perl(Test::Pod) >= 1.00 +BuildRequires: perl(Test::Pod::Coverage) >= 1.04 +Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) +Requires: perl(Perl::Critic) >= 1.082 +Requires: perl(Perl::MinimumVersion) >= 0.14 +Requires: perl(Readonly) >= 1.03 + +%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}^perl\\(Readonly\\)$ + +%description +This is a collection of Perl::Critic policies that are not included in the +Perl::Critic core for a variety of reasons. + +%prep +%setup -q -n Perl-Critic-More-%{version} +%patch0 -p0 + +%build +%{__perl} Build.PL installdirs=vendor +./Build + +%install +./Build install destdir=$RPM_BUILD_ROOT create_packlist=0 +%{_fixperms} $RPM_BUILD_ROOT/* + +%check +./Build test + +%files +%doc Changes LICENSE README TODO.pod +%{perl_vendorlib}/* +%{_mandir}/man3/* + +%changelog +* Fri Dec 27 2013 Daniel Mach - 1.000-9 +- Mass rebuild 2013-12-27 + +* Wed Oct 24 2012 Petr Pisar - 1.000-8 +- Modernize spec file + +* Fri Jul 20 2012 Fedora Release Engineering - 1.000-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Jul 13 2012 Petr Pisar - 1.000-6 +- Add Miscellanea::RequireRcsKeywords droped from Perl::Critic. Credits to Paul + Howarth. (bug #839815) + +* Wed Jun 20 2012 Petr Pisar - 1.000-5 +- Perl 5.16 rebuild + +* Fri Jan 13 2012 Fedora Release Engineering - 1.000-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Jul 26 2011 Marcela Mašláňová - 1.000-3 +- add RPM4.9 macro filter + +* Tue Jul 19 2011 Petr Sabata - 1.000-2 +- Perl mass rebuild + +* Thu Mar 24 2011 Petr Pisar 1.000-1 +- Specfile autogenerated by cpanspec 1.78. +- Remove BuildRoot stuff