[libdist-zilla-plugin-test-podspelling-perl] 18/86: automatically add author names from dist.ini to stopwords

Axel Beckert abe at deuxchevaux.org
Mon May 25 10:02:02 UTC 2015


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

abe pushed a commit to annotated tag 2.001001
in repository libdist-zilla-plugin-test-podspelling-perl.

commit 314d56d07a130be69103e2633de1cc72cdca26ad
Author: Marcel Gruenauer <hanekomu at gmail.com>
Date:   Sat May 28 23:20:28 2011 +0200

    automatically add author names from dist.ini to stopwords
---
 Changes                                   |  2 ++
 README                                    | 12 +++++++-----
 lib/Dist/Zilla/Plugin/PodSpellingTests.pm | 28 ++++++++++++++++++----------
 3 files changed, 27 insertions(+), 15 deletions(-)

diff --git a/Changes b/Changes
index 454953a..3565ee8 100644
--- a/Changes
+++ b/Changes
@@ -1,6 +1,8 @@
 Revision history for Perl extension {{$dist->name}}
 
 {{$NEXT}}
+    - automatically add author names from dist.ini to stopwords (thanks
+      xenoterracide for the suggestion)
 
 1.103491  2010-12-15 23:06:11 Europe/Vienna
 
diff --git a/README b/README
index fb881cf..920025c 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
     Dist::Zilla::Plugin::PodSpellingTests - Release tests for POD spelling
 
 VERSION
-    version 1.103491
+    version 1.111480
 
 SYNOPSIS
     In "dist.ini":
@@ -59,9 +59,11 @@ METHODS
 
     "stopwords" can appear multiple times, one word per line.
 
-    Defaults to nothing.
+    Normally no stopwords are added by default, but author names appearing
+    in "dist.ini" are automatically added as stopwords so you don't have to
+    add them manually just because they might appear in the "AUTHORS"
+    section of the generated POD document.
 
-ATTRIBUTES
 INSTALLATION
     See perlmodinstall for information and options on installing Perl
     modules.
@@ -80,8 +82,8 @@ AVAILABILITY
     <http://search.cpan.org/dist/Dist-Zilla-Plugin-PodSpellingTests/>.
 
     The development version lives at
-    <http://github.com/hanekomu/Dist-Zilla-Plugin-PodSpellingTests.git> and
-    may be cloned from
+    <http://github.com/hanekomu/Dist-Zilla-Plugin-PodSpellingTests> and may
+    be cloned from
     <git://github.com/hanekomu/Dist-Zilla-Plugin-PodSpellingTests.git>.
     Instead of sending patches, please fork this project using the standard
     git and github infrastructure.
diff --git a/lib/Dist/Zilla/Plugin/PodSpellingTests.pm b/lib/Dist/Zilla/Plugin/PodSpellingTests.pm
index 0202759..eefa317 100644
--- a/lib/Dist/Zilla/Plugin/PodSpellingTests.pm
+++ b/lib/Dist/Zilla/Plugin/PodSpellingTests.pm
@@ -30,6 +30,13 @@ around add_file => sub {
     if ($self->spell_cmd) {
         $set_spell_cmd = sprintf "set_spell_cmd('%s');", $self->spell_cmd;
     }
+
+    # automatically add author names to stopwords
+    for (@{ $self->zilla->authors }) {
+        local $_ = $_;    # we don't want to modify $_ in-place
+        s/<.*?>//g;
+        push @{ $self->stopwords }, /(\w{2,})/g;
+    }
     if (@{ $self->stopwords } > 0) {
         $add_stopwords = 'add_stopwords(<DATA>);';
         $stopwords = join "\n", '__DATA__', @{ $self->stopwords };
@@ -96,13 +103,11 @@ configuration:
 
 =head1 DESCRIPTION
 
-This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing the
-following file:
+This is an extension of L<Dist::Zilla::Plugin::InlineFiles>, providing
+the following file:
 
   xt/release/pod-spell.t - a standard Test::Spelling test
 
-=head1 ATTRIBUTES
-
 =method wordlist
 
 The module name of a word list you wish to use that works with
@@ -112,19 +117,23 @@ Defaults to L<Pod::Wordlist::hanekomu>.
 
 =method spell_cmd
 
-If C<spell_cmd> is set then C<set_spell_cmd( your_spell_command );> is added
-to the test file to allow for custom spell check programs.
+If C<spell_cmd> is set then C<set_spell_cmd( your_spell_command );> is
+added to the test file to allow for custom spell check programs.
 
 Defaults to nothing.
 
 =method stopwords
 
-If stopwords is set then C<add_stopwords( E<lt>DATAE<gt> )> is added to the
-test file and the words are added after the C<__DATA__> section.
+If stopwords is set then C<add_stopwords( E<lt>DATAE<gt> )> is added
+to the test file and the words are added after the C<__DATA__>
+section.
 
 C<stopwords> can appear multiple times, one word per line.
 
-Defaults to nothing.
+Normally no stopwords are added by default, but author names appearing in
+C<dist.ini> are automatically added as stopwords so you don't have to add them
+manually just because they might appear in the C<AUTHORS> section of the
+generated POD document.
 
 =begin Pod::Coverage
 
@@ -133,7 +142,6 @@ mvp_multivalue_args
 =end Pod::Coverage
 
 =cut
-
 __DATA__
 ___[ xt/release/pod-spell.t ]___
 #!perl

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-plugin-test-podspelling-perl.git



More information about the Pkg-perl-cvs-commits mailing list