Update to 1.132

- New upstream release 1.132
  New Features
  - In the ProhibitLeadingZeros policy, added an exception for mkfifo (GH#786)
  - Add colour support for Windows platforms (GH#700)
  - Perl::Critic now assumes that .psgi files are Perl, too (GH#805)
  - Variables::ProhibitUnusedVariables no longer gives a false positive for
    variables used in interpolation (GH#801)
  - Added the ability to specify a regex to tell what unused private
    subroutines are OK in Subroutines::ProhibitUnusedPrivateSubroutines; this
    is handy for Moose classes where there could be many false positives on
    _build_xxxx() subroutines (GH#811, GH#812)
  Dependencies
  - Perl::Critic now no longer relies on the deprecated Email::Address
    (GH #816)
  Bug Fixes
  - Recode Perl::Critic::Utils::all_perl_files() to use File::Find instead of
    opendir/readdir; this solves endless directory traversals if the
    directories contain circular symbolic references
  - Added missing requirement for Fatal.pm
  Documentation
  - Added CONTRIBUTING.md
- Switch upstream from search.cpan.org to metacpan.org
- Switch spell checker from aspell to hunspell
This commit is contained in:
Paul Howarth 2018-06-04 10:05:32 +01:00
parent 4d3f2aa276
commit f2ce4835fa
3 changed files with 243 additions and 14 deletions

View File

@ -0,0 +1,203 @@
From d83901363a9992a0a81b0580e809b30fa5ac3962 Mon Sep 17 00:00:00 2001
From: Paul Howarth <paul@city-fan.org>
Date: Fri, 21 Jul 2017 11:50:35 +0100
Subject: [PATCH] Change default spell check tool from aspell to hunspell
This is on the basis that most downstream users are already doing
or have migrated from aspell to hunspell due to hunspell being
actively maintained, unlike aspell.
https://wiki.ubuntu.com/ConsolidateSpellingLibs
https://wiki.gnome.org/Initiatives/SpellChecking
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860895
https://fedoraproject.org/wiki/Releases/FeatureDictionary
Unfortunately, hunspell prior to about version 1.2.12 (2010) had
problems with ASCII apostrophes, thus flagging errors for words
like "doesn't", "isn't" etc., which makes 1.2.12 pretty much a
minimum version requirement if incorporating this change.
---
.travis.yml | 4 ++--
.../Policy/BuiltinFunctions/ProhibitLvalueSubstr.pm | 2 +-
lib/Perl/Critic/Policy/Documentation/PodSpelling.pm | 20 ++++++++++----------
.../RequireCheckingReturnValueOfEval.pm | 2 +-
.../Critic/Policy/Modules/RequireBarewordIncludes.pm | 2 ++
.../RegularExpressions/ProhibitComplexRegexes.pm | 2 +-
.../Policy/Variables/RequireLexicalLoopIterators.pm | 2 +-
t/20_policy_pod_spelling.t | 4 ++--
xt/40_perlcriticrc-code | 2 +-
9 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 6eeb384..c068d44 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -30,8 +30,8 @@ notifications:
addons:
apt:
packages:
- - aspell
- - aspell-en
+ - hunspell
+ - hunspell-en-us
install:
diff --git a/lib/Perl/Critic/Policy/BuiltinFunctions/ProhibitLvalueSubstr.pm b/lib/Perl/Critic/Policy/BuiltinFunctions/ProhibitLvalueSubstr.pm
index dccaab0..1270780 100644
--- a/lib/Perl/Critic/Policy/BuiltinFunctions/ProhibitLvalueSubstr.pm
+++ b/lib/Perl/Critic/Policy/BuiltinFunctions/ProhibitLvalueSubstr.pm
@@ -64,7 +64,7 @@ __END__
=pod
-=for stopwords perlfunc substr 4th
+=for stopwords perl5005delta perlfunc substr 4th
=head1 NAME
diff --git a/lib/Perl/Critic/Policy/Documentation/PodSpelling.pm b/lib/Perl/Critic/Policy/Documentation/PodSpelling.pm
index 8049d89..de609ed 100644
--- a/lib/Perl/Critic/Policy/Documentation/PodSpelling.pm
+++ b/lib/Perl/Critic/Policy/Documentation/PodSpelling.pm
@@ -39,7 +39,7 @@ sub supported_parameters {
{
name => 'spell_command',
description => 'The command to invoke to check spelling.',
- default_string => 'aspell list',
+ default_string => 'hunspell -l',
behavior => 'string',
},
{
@@ -200,11 +200,11 @@ sub _run_spell_command {
# run spell command and fetch output
local $SIG{PIPE} = sub { $got_sigpipe = 1; };
my $command_line = join $SPACE, @{$self->_get_spell_command_line()};
- open my $aspell_out_fh, q{-|}, "$command_line < $outfile" ## Is this portable??
+ open my $speller_out_fh, q{-|}, "$command_line < $outfile" ## Is this portable??
or throw_generic "Failed to open handle to spelling program: $OS_ERROR";
- @words = uniq( <$aspell_out_fh> );
- close $aspell_out_fh
+ @words = uniq( <$speller_out_fh> );
+ close $speller_out_fh
or throw_generic "Failed to close handle to spelling program: $OS_ERROR";
for (@words) {
@@ -324,11 +324,11 @@ set a global list of spelling exceptions. To do this, put entries in
a F<.perlcriticrc> file like this:
[Documentation::PodSpelling]
- spell_command = aspell list
+ spell_command = hunspell -l
stop_words = gibbles foobar
stop_words_file = some/path/with/stop/words.txt
-The default spell command is C<aspell list> and it is interpreted as a
+The default spell command is C<hunspell -l> and it is interpreted as a
shell command. We parse the individual arguments via
L<Text::ParseWords|Text::ParseWords> so feel free to use quotes around
your arguments. If the executable path is an absolute file name, it
@@ -358,13 +358,13 @@ together into a single list of exemptions.
A spell checking program is not included with Perl::Critic.
-The results of failures for this policy can be confusing when F<aspell>
+The results of failures for this policy can be confusing when F<hunspell>
complains about words containing punctuation such as hyphens and apostrophes.
-In this situation F<aspell> will often only emit part of the word that it
-thinks is misspelled. For example, if you ask F<aspell> to check
+In this situation F<hunspell> will often only emit part of the word that it
+thinks is misspelled. For example, if you ask F<hunspell> to check
"foobie-bletch", the output only complains about "foobie". Unfortunately,
you'll have to look through your POD to figure out what the real word that
-F<aspell> is complaining about is. One thing to try is looking at the output
+F<hunspell> is complaining about is. One thing to try is looking at the output
of C<< perl -MPod::Spell -e 'print
Pod::Spell->new()->parse_from_file("lib/Your/Module.pm")' >> to see what is
actually being checked for spelling.
diff --git a/lib/Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm b/lib/Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm
index 6865003..6845573 100644
--- a/lib/Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm
+++ b/lib/Perl/Critic/Policy/ErrorHandling/RequireCheckingReturnValueOfEval.pm
@@ -299,7 +299,7 @@ __END__
=pod
-=for stopwords destructors
+=for stopwords destructors perl5
=head1 NAME
diff --git a/lib/Perl/Critic/Policy/Modules/RequireBarewordIncludes.pm b/lib/Perl/Critic/Policy/Modules/RequireBarewordIncludes.pm
index 5ad8768..b084dac 100644
--- a/lib/Perl/Critic/Policy/Modules/RequireBarewordIncludes.pm
+++ b/lib/Perl/Critic/Policy/Modules/RequireBarewordIncludes.pm
@@ -46,6 +46,8 @@ __END__
=pod
+=for stopwords Perl4
+
=head1 NAME
Perl::Critic::Policy::Modules::RequireBarewordIncludes - Write C<require Module> instead of C<require 'Module.pm'>.
diff --git a/lib/Perl/Critic/Policy/RegularExpressions/ProhibitComplexRegexes.pm b/lib/Perl/Critic/Policy/RegularExpressions/ProhibitComplexRegexes.pm
index 46aa649..30316e3 100644
--- a/lib/Perl/Critic/Policy/RegularExpressions/ProhibitComplexRegexes.pm
+++ b/lib/Perl/Critic/Policy/RegularExpressions/ProhibitComplexRegexes.pm
@@ -99,7 +99,7 @@ __END__
=pod
-=for stopwords BNF Tatsuhiko Miyagawa
+=for stopwords BNF RFC822 Tatsuhiko Miyagawa
=head1 NAME
diff --git a/lib/Perl/Critic/Policy/Variables/RequireLexicalLoopIterators.pm b/lib/Perl/Critic/Policy/Variables/RequireLexicalLoopIterators.pm
index 4690658..8185dd9 100644
--- a/lib/Perl/Critic/Policy/Variables/RequireLexicalLoopIterators.pm
+++ b/lib/Perl/Critic/Policy/Variables/RequireLexicalLoopIterators.pm
@@ -66,7 +66,7 @@ __END__
=pod
-=for stopwords foreach perlsyn
+=for stopwords foreach perl5004delta perlsyn
=head1 NAME
diff --git a/t/20_policy_pod_spelling.t b/t/20_policy_pod_spelling.t
index f41a5c6..7b37030 100644
--- a/t/20_policy_pod_spelling.t
+++ b/t/20_policy_pod_spelling.t
@@ -58,10 +58,10 @@ $code = <<'END_PERL';
=cut
END_PERL
-# Sorry about the double negative. The idea is that if aspell fails (say,
+# Sorry about the double negative. The idea is that if hunspell fails (say,
# because it can not find the right dictionary) or pcritique returns a
# non-zero number we want to skip. We have to negate the eval to catch the
-# aspell failure, and then negate pcritique because we negated the eval.
+# hunspell failure, and then negate pcritique because we negated the eval.
# Clearer code welcome.
if ( ! eval { ! pcritique($policy, \$code) } ) {
skip 'Test environment is not English', $NUMBER_OF_TESTS;
diff --git a/xt/40_perlcriticrc-code b/xt/40_perlcriticrc-code
index c37fede..253d15c 100644
--- a/xt/40_perlcriticrc-code
+++ b/xt/40_perlcriticrc-code
@@ -18,7 +18,7 @@ strict = 1
[-Documentation::RequirePodLinksIncludeText]
[Documentation::PodSpelling]
-spell_command = aspell list -l en_US
+spell_command = hunspell -l -d en_US
stop_words_file = xt/40_stop_words
[Documentation::RequirePodSections]
--
2.9.4

View File

@ -1,16 +1,16 @@
Name: perl-Perl-Critic
Version: 1.130
Release: 3%{?dist}
Version: 1.132
Release: 1%{?dist}
Summary: Critique Perl source code for best-practices
License: GPL+ or Artistic
URL: http://search.cpan.org/dist/Perl-Critic/
Source0: http://search.cpan.org/CPAN/authors/id/P/PE/PETDANCE/Perl-Critic-%{version}.tar.gz
URL: https://metacpan.org/release/Perl-Critic
Source0: https://cpan.metacpan.org/authors/id/P/PE/PETDANCE/Perl-Critic-%{version}.tar.gz
Patch0: 0001-Change-default-spell-check-tool-from-aspell-to-hunsp.patch
BuildArch: noarch
# Build process
BuildRequires: coreutils
BuildRequires: findutils
BuildRequires: make
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(lib)
@ -18,17 +18,16 @@ BuildRequires: perl(Module::Build) >= 0.42
BuildRequires: perl(Task::Weaken)
# Module requirements
%if ! (0%{?rhel:1})
BuildRequires: aspell-en
%endif
BuildRequires: hunspell >= 1.2.12
BuildRequires: hunspell-en
BuildRequires: perl(B::Keywords) >= 1.05
BuildRequires: perl(base)
BuildRequires: perl(Carp)
BuildRequires: perl(Config::Tiny) >= 2
BuildRequires: perl(Email::Address) >= 1.889
BuildRequires: perl(English)
BuildRequires: perl(Exception::Class) >= 1.23
BuildRequires: perl(Exporter) >= 5.58
BuildRequires: perl(File::Find)
BuildRequires: perl(File::HomeDir)
BuildRequires: perl(File::Path)
BuildRequires: perl(File::Spec)
@ -47,6 +46,7 @@ BuildRequires: perl(Pod::Select)
BuildRequires: perl(Pod::Spell) >= 1
BuildRequires: perl(Pod::Usage)
BuildRequires: perl(PPI) >= 1.224
BuildRequires: perl(PPIx::QuoteLike)
BuildRequires: perl(PPIx::Regexp) >= 0.010
BuildRequires: perl(PPIx::Utilities::Node)
BuildRequires: perl(PPIx::Utilities::Statement) >= 1.001
@ -83,9 +83,7 @@ BuildRequires: perl(Test::Without::Module)
# Optional/not automatically detected runtime dependencies
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
%if ! (0%{?rhel:1})
Requires: aspell
%endif
Requires: hunspell >= 1.2.12
Requires: perl(File::HomeDir)
Requires: perl(File::Which)
Requires: perl(Module::Pluggable) >= 3.1
@ -118,6 +116,9 @@ of Perl code were mixed directly in the test script. That sucked.
%prep
%setup -q -n Perl-Critic-%{version}
# Switch spell checker tool from aspell to hunspell
%patch0 -p1
# Drop exec bits from samples/docs to avoid dependency bloat
find tools examples -type f -exec chmod -c -x {} ';'
@ -138,7 +139,7 @@ LC_ALL=en_US ./Build %{!?perl_bootstrap:author}test
%else
%doc LICENSE
%endif
%doc Changes README TODO.pod examples/ extras/ tools/
%doc Changes CONTRIBUTING.md README TODO.pod examples/ extras/ tools/
%{_bindir}/perlcritic
%{perl_vendorlib}/Perl/
%{_mandir}/man1/perlcritic.1*
@ -149,6 +150,31 @@ LC_ALL=en_US ./Build %{!?perl_bootstrap:author}test
%{_mandir}/man3/Test::Perl::Critic::Policy.3*
%changelog
* Fri Jun 1 2018 Paul Howarth <paul@city-fan.org> - 1.132-1
- Update to 1.132
New Features
- In the ProhibitLeadingZeros policy, added an exception for mkfifo (GH#786)
- Add colour support for Windows platforms (GH#700)
- Perl::Critic now assumes that .psgi files are Perl, too (GH#805)
- Variables::ProhibitUnusedVariables no longer gives a false positive for
variables used in interpolation (GH#801)
- Added the ability to specify a regex to tell what unused private
subroutines are OK in Subroutines::ProhibitUnusedPrivateSubroutines; this
is handy for Moose classes where there could be many false positives on
_build_xxxx() subroutines (GH#811, GH#812)
Dependencies
- Perl::Critic now no longer relies on the deprecated Email::Address
(GH #816)
Bug Fixes
- Recode Perl::Critic::Utils::all_perl_files() to use File::Find instead of
opendir/readdir; this solves endless directory traversals if the
directories contain circular symbolic references
- Added missing requirement for Fatal.pm
Documentation
- Added CONTRIBUTING.md
- Switch upstream from search.cpan.org to metacpan.org
- Switch spell checker from aspell to hunspell
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.130-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

View File

@ -1 +1 @@
SHA512 (Perl-Critic-1.130.tar.gz) = b443ddbb5905a61835061f49d7f10e2e71579e5df96778eb183c3d1e9987342e1536db61196b32e66a192c92916eafd9ebb7b713b0be71ce89c1f93155e89828
SHA512 (Perl-Critic-1.132.tar.gz) = 489d551b4913071a9001e8476425079b3aeef44838feff622edfdb64ca09f62b569f5338d2e1982d3ccd3fdb8f30caf077ceac5ec1beebafbde7a01d6deed890