[libmodule-cpants-analyse-perl] 01/01: Imported Upstream version 0.92+dfsg

Salvatore Bonaccorso carnil at debian.org
Sun Sep 22 22:07:48 UTC 2013


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

carnil pushed a commit to annotated tag upstream/0.92+dfsg
in repository libmodule-cpants-analyse-perl.

commit f45eb85eb7cc1983154325cdd6271869b99349fb
Author: Salvatore Bonaccorso <carnil at debian.org>
Date:   Sun Sep 22 23:58:04 2013 +0200

    Imported Upstream version 0.92+dfsg
---
 Changes                                       |   10 +++
 MANIFEST                                      |    5 +-
 META.json                                     |   40 ++++-----
 META.yml                                      |   40 ++++-----
 Makefile.PL                                   |    2 +-
 lib/Module/CPANTS/Analyse.pm                  |    2 +-
 lib/Module/CPANTS/Kwalitee.pm                 |    2 +-
 lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm |   23 ++---
 lib/Module/CPANTS/Kwalitee/CpantsErrors.pm    |    2 +-
 lib/Module/CPANTS/Kwalitee/Distname.pm        |    2 +-
 lib/Module/CPANTS/Kwalitee/Distros.pm         |    2 +-
 lib/Module/CPANTS/Kwalitee/Files.pm           |    2 +-
 lib/Module/CPANTS/Kwalitee/FindModules.pm     |    2 +-
 lib/Module/CPANTS/Kwalitee/License.pm         |   30 +++++--
 lib/Module/CPANTS/Kwalitee/Manifest.pm        |    2 +-
 lib/Module/CPANTS/Kwalitee/MetaYML.pm         |    2 +-
 lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm   |    2 +-
 lib/Module/CPANTS/Kwalitee/Pod.pm             |    2 +-
 lib/Module/CPANTS/Kwalitee/Prereq.pm          |    8 +-
 lib/Module/CPANTS/Kwalitee/Repackageable.pm   |    2 +-
 lib/Module/CPANTS/Kwalitee/Signature.pm       |    2 +-
 lib/Module/CPANTS/Kwalitee/Uses.pm            |   98 +++++++++------------
 lib/Module/CPANTS/Kwalitee/Version.pm         |    2 +-
 xt/kwalitee/has_license_in_source_file.t      |    3 +
 xt/strict_warnings_equiv.t                    |  117 +++++++++++++++++++++++++
 25 files changed, 262 insertions(+), 142 deletions(-)

diff --git a/Changes b/Changes
index 6a9691c..a085d19 100644
--- a/Changes
+++ b/Changes
@@ -4,6 +4,16 @@
 
 Changes - Revision history for Module-CPANTS-Analyse
 
+=head2 0.92 2013-09-22
+
+=over
+
+=item Fixed a case when more than one license sections come in row (spotted by ysasaki++) (ishigaki)
+
+=item stopped checking auto_features (ishigaki)
+
+=back
+
 =head2 0.91 2013-09-05
 
 =over
diff --git a/MANIFEST b/MANIFEST
index 40c126c..479a1dd 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -23,6 +23,8 @@ lib/Module/CPANTS/Kwalitee/Version.pm
 Makefile.PL
 MANIFEST			This list of files
 MANIFEST.SKIP
+META.json
+META.yml
 README
 t/00_load.t
 t/02_kwalitee.t
@@ -77,5 +79,4 @@ xt/kwalitee/proper_libs.t
 xt/kwalitee/Test.pm
 xt/kwalitee/use_strict.t
 xt/kwalitee/use_warnings.t
-META.yml
-META.json
+xt/strict_warnings_equiv.t
diff --git a/META.json b/META.json
index f93f990..898e16b 100644
--- a/META.json
+++ b/META.json
@@ -4,7 +4,7 @@
       "Lars Dɪᴇᴄᴋᴏᴡ <daxim at cpan.org>"
    ],
    "dynamic_config" : 1,
-   "generated_by" : "Module::Build version 0.4005, CPAN::Meta::Converter version 2.132140",
+   "generated_by" : "Module::Build version 0.4007, CPAN::Meta::Converter version 2.132620",
    "keywords" : [
       "CPANTS",
       "kwalitee"
@@ -57,75 +57,75 @@
    "provides" : {
       "Module::CPANTS::Analyse" : {
          "file" : "lib/Module/CPANTS/Analyse.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee" : {
          "file" : "lib/Module/CPANTS/Kwalitee.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::BrokenInstaller" : {
          "file" : "lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::CpantsErrors" : {
          "file" : "lib/Module/CPANTS/Kwalitee/CpantsErrors.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Distname" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Distname.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Distros" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Distros.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Files" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Files.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::FindModules" : {
          "file" : "lib/Module/CPANTS/Kwalitee/FindModules.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::License" : {
          "file" : "lib/Module/CPANTS/Kwalitee/License.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Manifest" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Manifest.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::MetaYML" : {
          "file" : "lib/Module/CPANTS/Kwalitee/MetaYML.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::NeedsCompiler" : {
          "file" : "lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Pod" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Pod.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Prereq" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Prereq.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Repackageable" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Repackageable.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Signature" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Signature.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Uses" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Uses.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       },
       "Module::CPANTS::Kwalitee::Version" : {
          "file" : "lib/Module/CPANTS/Kwalitee/Version.pm",
-         "version" : "0.91"
+         "version" : "0.92"
       }
    },
    "release_status" : "stable",
@@ -141,5 +141,5 @@
          "url" : "https://github.com/cpants/Module-CPANTS-Analyse"
       }
    },
-   "version" : "0.91"
+   "version" : "0.92"
 }
diff --git a/META.yml b/META.yml
index 9161810..b227a30 100644
--- a/META.yml
+++ b/META.yml
@@ -11,7 +11,7 @@ build_requires:
 configure_requires:
   Module::Build: 0.4
 dynamic_config: 1
-generated_by: 'Module::Build version 0.4005, CPAN::Meta::Converter version 2.132140'
+generated_by: 'Module::Build version 0.4007, CPAN::Meta::Converter version 2.132620'
 keywords:
   - CPANTS
   - kwalitee
@@ -23,58 +23,58 @@ name: Module-CPANTS-Analyse
 provides:
   Module::CPANTS::Analyse:
     file: lib/Module/CPANTS/Analyse.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee:
     file: lib/Module/CPANTS/Kwalitee.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::BrokenInstaller:
     file: lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::CpantsErrors:
     file: lib/Module/CPANTS/Kwalitee/CpantsErrors.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Distname:
     file: lib/Module/CPANTS/Kwalitee/Distname.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Distros:
     file: lib/Module/CPANTS/Kwalitee/Distros.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Files:
     file: lib/Module/CPANTS/Kwalitee/Files.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::FindModules:
     file: lib/Module/CPANTS/Kwalitee/FindModules.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::License:
     file: lib/Module/CPANTS/Kwalitee/License.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Manifest:
     file: lib/Module/CPANTS/Kwalitee/Manifest.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::MetaYML:
     file: lib/Module/CPANTS/Kwalitee/MetaYML.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::NeedsCompiler:
     file: lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Pod:
     file: lib/Module/CPANTS/Kwalitee/Pod.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Prereq:
     file: lib/Module/CPANTS/Kwalitee/Prereq.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Repackageable:
     file: lib/Module/CPANTS/Kwalitee/Repackageable.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Signature:
     file: lib/Module/CPANTS/Kwalitee/Signature.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Uses:
     file: lib/Module/CPANTS/Kwalitee/Uses.pm
-    version: 0.91
+    version: 0.92
   Module::CPANTS::Kwalitee::Version:
     file: lib/Module/CPANTS/Kwalitee/Version.pm
-    version: 0.91
+    version: 0.92
 requires:
   Archive::Any::Lite: 0.06
   Archive::Tar: 1.48
@@ -98,4 +98,4 @@ resources:
   homepage: http://cpants.cpanauthors.org
   license: http://dev.perl.org/licenses/
   repository: https://github.com/cpants/Module-CPANTS-Analyse
-version: 0.91
+version: 0.92
diff --git a/Makefile.PL b/Makefile.PL
index 3fceb14..fe8bd6e 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.4005
+# Note: this file was auto-generated by Module::Build::Compat version 0.4007
 require 5.006;
 use ExtUtils::MakeMaker;
 WriteMakefile
diff --git a/lib/Module/CPANTS/Analyse.pm b/lib/Module/CPANTS/Analyse.pm
index ebaaa2e..1afb06e 100644
--- a/lib/Module/CPANTS/Analyse.pm
+++ b/lib/Module/CPANTS/Analyse.pm
@@ -13,7 +13,7 @@ use IO::Capture::Stdout;
 use IO::Capture::Stderr;
 use CPAN::DistnameInfo;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 # setup logger
 if (! main->can('logger')) {
diff --git a/lib/Module/CPANTS/Kwalitee.pm b/lib/Module/CPANTS/Kwalitee.pm
index cb7ac5b..e62e7cc 100644
--- a/lib/Module/CPANTS/Kwalitee.pm
+++ b/lib/Module/CPANTS/Kwalitee.pm
@@ -6,7 +6,7 @@ use base qw(Class::Accessor);
 use Module::Pluggable search_path=>['Module::CPANTS::Kwalitee'];
 use Carp;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 __PACKAGE__->mk_accessors(qw(generators _gencache _genhashcache _available _total));
 
diff --git a/lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm b/lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm
index d0dca43..2ec0843 100644
--- a/lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm
+++ b/lib/Module/CPANTS/Kwalitee/BrokenInstaller.pm
@@ -5,7 +5,7 @@ use File::Find;
 use File::Spec::Functions qw(catdir catfile abs2rel);
 use File::stat;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 100 }
 
@@ -32,12 +32,10 @@ sub analyse {
         $me->d->{module_install_version} = my $version = $2;
         my $non_devel = $version;
         $non_devel =~ s/_\d+$//;
-        if ($non_devel < 0.61) {
+        if ($non_devel < 0.61 or $non_devel == 1.04) {
             $me->d->{broken_module_install} = $version;
         }
-        elsif ($non_devel < 0.89) {
-            $me->d->{broken_module_install} = 0;
-            
+        if ($non_devel < 0.89) {
             my $makefilepl = catfile($distdir, 'Makefile.PL');
             return if not -f $makefilepl;
             
@@ -49,13 +47,8 @@ sub analyse {
             
             return if not defined $mftext;
 
-            if ($non_devel < 0.61) {
-                $me->d->{broken_module_install} = $version;
-                return;
-            }
-
             if ($mftext =~ /auto_install/) {
-                $me->d->{mi_auto_install_used} = 1;
+                $me->d->{broken_auto_install} = 1;
             } else {
                 return;
             }
@@ -64,12 +57,6 @@ sub analyse {
                 $me->d->{broken_module_install} = $version;
             }
         }
-        elsif ($non_devel == 1.04) {
-            $me->d->{broken_module_install} = $version;
-        }
-        else {
-            $me->d->{broken_module_install} = 0;
-        }
     }
     else {
         # Unknown version (parsing $VERSION failed)
@@ -98,7 +85,7 @@ sub kwalitee_indicators {
         error=>q{This distribution uses an old version of Module::Install. Versions of Module::Install prior to 0.89 does not detect correcty that CPAN/CPANPLUS shell is used.},
         remedy=>q{Upgrade the bundled version of Module::Install to at least 0.89, but preferably to the most current release. Alternatively, you can switch to another build system / installer that does not suffer from this problem. (ExtUtils::MakeMaker, Module::Build both of which have their own set of problems.)},
         code=>sub {
-            shift->{mi_auto_install_used} ? 0 : 1 },
+            shift->{broken_auto_install} ? 0 : 1 },
         details=> sub {
             q{This distribution uses obsolete Module::Install version }.(shift->{module_install_version});
         },
diff --git a/lib/Module/CPANTS/Kwalitee/CpantsErrors.pm b/lib/Module/CPANTS/Kwalitee/CpantsErrors.pm
index 67fbc66..22c004a 100644
--- a/lib/Module/CPANTS/Kwalitee/CpantsErrors.pm
+++ b/lib/Module/CPANTS/Kwalitee/CpantsErrors.pm
@@ -3,7 +3,7 @@ use warnings;
 use strict;
 use version;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 1000 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/Distname.pm b/lib/Module/CPANTS/Kwalitee/Distname.pm
index 349d7d7..218fecd 100644
--- a/lib/Module/CPANTS/Kwalitee/Distname.pm
+++ b/lib/Module/CPANTS/Kwalitee/Distname.pm
@@ -2,7 +2,7 @@ package Module::CPANTS::Kwalitee::Distname;
 use warnings;
 use strict;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 20 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/Distros.pm b/lib/Module/CPANTS/Kwalitee/Distros.pm
index 925e0b6..c53be73 100644
--- a/lib/Module/CPANTS/Kwalitee/Distros.pm
+++ b/lib/Module/CPANTS/Kwalitee/Distros.pm
@@ -2,7 +2,7 @@ package Module::CPANTS::Kwalitee::Distros;
 use warnings;
 use strict;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 800 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/Files.pm b/lib/Module/CPANTS/Kwalitee/Files.pm
index a129f5b..b71b454 100644
--- a/lib/Module/CPANTS/Kwalitee/Files.pm
+++ b/lib/Module/CPANTS/Kwalitee/Files.pm
@@ -7,7 +7,7 @@ use File::stat;
 use File::Basename;
 use Data::Dumper;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 15 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/FindModules.pm b/lib/Module/CPANTS/Kwalitee/FindModules.pm
index 1759b35..d072da5 100644
--- a/lib/Module/CPANTS/Kwalitee/FindModules.pm
+++ b/lib/Module/CPANTS/Kwalitee/FindModules.pm
@@ -4,7 +4,7 @@ use strict;
 use Data::Dumper;
 use File::Spec::Functions;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 30 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/License.pm b/lib/Module/CPANTS/Kwalitee/License.pm
index 40aba19..825f2af 100644
--- a/lib/Module/CPANTS/Kwalitee/License.pm
+++ b/lib/Module/CPANTS/Kwalitee/License.pm
@@ -4,7 +4,7 @@ use strict;
 use File::Spec::Functions qw(catfile);
 use Software::LicenseUtils;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 100 }
 
@@ -46,14 +46,28 @@ sub analyse {
         my @unknown_license_texts;
         while(<$fh>) {
             if (/^=head\d\s+.*\b(?i:LICEN[CS]E|LICEN[CS]ING|COPYRIGHT|LEGAL)\b/) {
+                if ($in_pod) {
+                    my @guessed = Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n");
+                    if (@guessed) {
+                        push @possible_licenses, @guessed;
+                    } else {
+                        push @unknown_license_texts, $pod;
+                    }
+                }
+
                 $in_pod = 1;
                 $pod = "=head1 LICENSE\n";
             }
             elsif (/^=(?:head\d\s+|cut)\b/) {
+                if ($in_pod) {
+                    my @guessed = Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n");
+                    if (@guessed) {
+                        push @possible_licenses, @guessed;
+                    } else {
+                        push @unknown_license_texts, $pod;
+                    }
+                }
                 $in_pod = 0;
-                push @possible_licenses, Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n");
-
-                push @unknown_license_texts, $pod unless @possible_licenses;
                 $pod = '';
             }
             elsif ($in_pod) {
@@ -61,8 +75,12 @@ sub analyse {
             }
         }
         if ($pod) {
-            push @possible_licenses, Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n");
-            push @unknown_license_texts, $pod unless @possible_licenses;
+            my @guessed = Software::LicenseUtils->guess_license_from_pod("$pod\n\n=cut\n");
+            if (@guessed) {
+                push @possible_licenses, @guessed;
+            } else {
+                push @unknown_license_texts, $pod;
+            }
         }
         $me->d->{unknown_license_texts} = join "\n", @unknown_license_texts;
 
diff --git a/lib/Module/CPANTS/Kwalitee/Manifest.pm b/lib/Module/CPANTS/Kwalitee/Manifest.pm
index c034777..74f6ba0 100644
--- a/lib/Module/CPANTS/Kwalitee/Manifest.pm
+++ b/lib/Module/CPANTS/Kwalitee/Manifest.pm
@@ -4,7 +4,7 @@ use strict;
 use File::Spec::Functions qw(catfile);
 use Array::Diff;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 100 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/MetaYML.pm b/lib/Module/CPANTS/Kwalitee/MetaYML.pm
index 2872827..89dea56 100644
--- a/lib/Module/CPANTS/Kwalitee/MetaYML.pm
+++ b/lib/Module/CPANTS/Kwalitee/MetaYML.pm
@@ -6,7 +6,7 @@ use CPAN::Meta::YAML;
 use CPAN::Meta::Validator;
 use List::Util qw/first/;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 10 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm b/lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm
index 8bb777a..9a0621b 100644
--- a/lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm
+++ b/lib/Module/CPANTS/Kwalitee/NeedsCompiler.pm
@@ -2,7 +2,7 @@ package Module::CPANTS::Kwalitee::NeedsCompiler;
 use warnings;
 use strict;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 200 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/Pod.pm b/lib/Module/CPANTS/Kwalitee/Pod.pm
index 014125b..f1f9af8 100644
--- a/lib/Module/CPANTS/Kwalitee/Pod.pm
+++ b/lib/Module/CPANTS/Kwalitee/Pod.pm
@@ -2,7 +2,7 @@ package Module::CPANTS::Kwalitee::Pod;
 use warnings;
 use strict;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 100 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/Prereq.pm b/lib/Module/CPANTS/Kwalitee/Prereq.pm
index 1c3906a..a2fc61f 100644
--- a/lib/Module/CPANTS/Kwalitee/Prereq.pm
+++ b/lib/Module/CPANTS/Kwalitee/Prereq.pm
@@ -4,7 +4,7 @@ use strict;
 use File::Spec::Functions qw(catfile);
 use Text::Balanced qw/extract_bracketed/;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 100 }
 
@@ -97,7 +97,8 @@ sub _from_build_pl {
         recommends     => 'is_optional_prereq',
     );
     my %res;
-    while($build_pl =~ s/^.*?((?:(?:configure|build|test)_)?requires|recommends|conflicts|auto_features)\s*=>\s*\{/{/s) {
+    # TODO: auto_features
+    while($build_pl =~ s/^.*?((?:(?:configure|build|test)_)?requires|recommends|conflicts)\s*=>\s*\{/{/s) {
         my $rel = $1;
         my ($block, $left) = extract_bracketed($build_pl, '{}');
         last unless $block;
@@ -106,9 +107,10 @@ sub _from_build_pl {
         if ($hashref && ref $hashref eq ref {}) {
             for my $module (keys %$hashref) {
                 my $type = $rel =~ /_/ ? $rel : "runtime_$rel";
+                my ($version) = ($hashref->{$module} || 0) =~ /^([0-9.]+)/;
                 push @{$res{$module} ||= []}, {
                     requires => $module,
-                    version => $hashref->{$module},
+                    version => $version,
                     type => $type,
                     ($map{$rel} ? ($map{$rel} => 1) : ()),
                 };
diff --git a/lib/Module/CPANTS/Kwalitee/Repackageable.pm b/lib/Module/CPANTS/Kwalitee/Repackageable.pm
index e719f56..0883c9f 100644
--- a/lib/Module/CPANTS/Kwalitee/Repackageable.pm
+++ b/lib/Module/CPANTS/Kwalitee/Repackageable.pm
@@ -2,7 +2,7 @@ package Module::CPANTS::Kwalitee::Repackageable;
 use warnings;
 use strict;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 900 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/Signature.pm b/lib/Module/CPANTS/Kwalitee/Signature.pm
index 082cf71..76e10fc 100644
--- a/lib/Module/CPANTS/Kwalitee/Signature.pm
+++ b/lib/Module/CPANTS/Kwalitee/Signature.pm
@@ -2,7 +2,7 @@ package Module::CPANTS::Kwalitee::Signature;
 use strict;
 use warnings;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 100 }
 
diff --git a/lib/Module/CPANTS/Kwalitee/Uses.pm b/lib/Module/CPANTS/Kwalitee/Uses.pm
index e16dabb..9a60e75 100644
--- a/lib/Module/CPANTS/Kwalitee/Uses.pm
+++ b/lib/Module/CPANTS/Kwalitee/Uses.pm
@@ -7,7 +7,36 @@ use Set::Scalar qw();
 use Data::Dumper;
 use version;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
+
+# These equivalents should be reasonably well-known and, preferably,
+# well-documented. Don't add obscure modules used by only one person
+# or a few people, to keep the list relatively small and to encourage
+# people to use a better equivalent.
+# "use_(strict|warnings)" should fail if someone feels the need
+# to add "use $1;" in the modules.
+our @STRICT_EQUIV = qw( strict );
+our @WARNINGS_EQUIV = qw( warnings );
+our @STRICT_WARNINGS_EQUIV = qw(
+  common::sense
+  Any::Moose
+  Catmandu::Sane Coat
+  Dancer
+  Mo
+  Modern::Perl
+  Moo Moo::Role
+  Moose Moose::Role Moose::Exporter
+  MooseX::Declare MooseX::Role::Parameterized MooseX::Types
+  Mouse Mouse::Role
+  perl5 perl5i::1 perl5i::2 perl5i::latest
+  Role::Tiny
+  strictures
+);
+# These modules require a flag to enforce strictness.
+push @STRICT_WARNINGS_EQUIV, qw(
+  Mojo::Base
+  Spiffy
+);
 
 sub order { 100 }
 
@@ -44,6 +73,7 @@ sub analyse {
         while (my ($mod,$cnt)=each%{$p->used}) {
             next if $skip{$mod};
             next if $mod =~ /::$/;  # see RT#35092
+            next unless $mod =~ /^[A-Za-z0-9:_]+$/;
             $uses{$mod}{module} = $mod;
             $uses{$mod}{in_code} += $cnt;
             $uses{$mod}{evals_in_code} += $p->used_in_eval($mod) || 0;
@@ -58,6 +88,8 @@ sub analyse {
 
         while (my ($mod,$cnt)=each%{$pt->used}) {
             next if $skip{$mod};
+            next if $mod =~ /::$/;  # see RT#35092
+            next unless $mod =~ /^[A-Za-z0-9:_]+$/;
             if (@test_modules) {
                 next if grep {/(?:^|::)$mod$/} @test_modules;
             }
@@ -77,6 +109,7 @@ sub analyse {
         while (my ($mod,$cnt)=each%{$p->used}) {
             next if $skip{$mod};
             next if $mod =~ /::$/;  # see RT#35092
+            next unless $mod =~ /^[A-Za-z0-9:_]+$/;
             $uses{$mod}{module} = $mod;
             $uses{$mod}{in_config} += $cnt;
             $uses{$mod}{evals_in_config} += $p->used_in_eval($mod) || 0;
@@ -95,8 +128,8 @@ sub kwalitee_indicators {
     return [
         {
             name=>'use_strict',
-            error=>q{This distribution does not 'use strict;' in all of its modules.},
-            remedy=>q{Add 'use strict' to all modules.},
+            error=>q{This distribution does not 'use strict;' (or its equivalents) in all of its modules. Note that this is not about the actual strictness of the modules. It's bad if nobody can tell whether the modules are strictly written or not, without reading the source code of your favorite clever module that actually enforces strictness. In other words, it's bad if someone feels the need to add 'use strict' to the modules.},
+            remedy=>q{Add 'use strict' to all modules, or convince us that your favorite module is well-known enough and people can easily see the modules are strictly written.},
             code=>sub {
                 my $d       = shift;
                 my $modules = $d->{modules};
@@ -104,33 +137,7 @@ sub kwalitee_indicators {
                 return 0 unless $modules && $uses;
 
                 # There are lots of acceptable strict alternatives
-                my $strict_equivalents = Set::Scalar->new->insert(qw(
-                    strict
-                    Any::Moose
-                    Class::Spiffy
-                    Coat
-                    common::sense
-                    Dancer
-                    Mo
-                    Modern::Perl
-                    Mojo::Base
-                    Moo
-                    Moo::Role
-                    Moose
-                    Moose::Role
-                    Moose::Exporter
-                    MooseX::Declare
-                    MooseX::Role::Parameterized
-                    MooseX::Types
-                    Mouse
-                    Mouse::Role
-                    perl5
-                    perl5i::1
-                    perl5i::2
-                    perl5i::latest
-                    Spiffy
-                    strictures
-                ));
+                my $strict_equivalents = Set::Scalar->new->insert(@STRICT_EQUIV, @STRICT_WARNINGS_EQUIV);
 
                 my $perl_version_with_implicit_stricture = version->new('5.011');
                 my @no_strict;
@@ -153,41 +160,16 @@ sub kwalitee_indicators {
         },
         {
             name=>'use_warnings',
-            error=>q{This distribution does not 'use warnings;' in all of its modules.},
+            error=>q{This distribution does not 'use warnings;' in all of its modules. Note that this is not about that your modules actually warn when something bad happens. It's bad if nobody can tell if modules warns or not, without reading the source code of your favorite module that actually enforces warnings. In other words, it's bad if someone feels the need to add 'use warnings' to the modules.},
             is_extra=>1,
-            remedy=>q{Add 'use warnings' to all modules. (This will require perl > 5.6)},
+            remedy=>q{Add 'use warnings' to all modules (this will require perl > 5.6), or convince us that your favorite module is well-known enough and people can easily see the modules warn when something bad happens.},
             code=>sub {
                 my $d       = shift;
                 my $modules = $d->{modules};
                 my $uses    = $d->{uses};
                 return 0 unless $modules && $uses;
 
-                my $warnings_equivalents = Set::Scalar->new->insert(qw(
-                    warnings
-                    Any::Moose
-                    Class::Spiffy
-                    Coat
-                    common::sense
-                    Dancer
-                    Mo
-                    Modern::Perl
-                    Mojo::Base
-                    Moo
-                    Moo::Role
-                    Moose
-                    Moose::Role
-                    Moose::Exporter
-                    MooseX::Declare
-                    MooseX::Types
-                    Mouse
-                    Mouse::Role
-                    perl5
-                    perl5i::1
-                    perl5i::2
-                    perl5i::latest
-                    Spiffy
-                    strictures
-                ));
+                my $warnings_equivalents = Set::Scalar->new->insert(@WARNINGS_EQUIV, @STRICT_WARNINGS_EQUIV);
 
                 my @no_warnings;
                 for my $module (@{ $modules }) {
diff --git a/lib/Module/CPANTS/Kwalitee/Version.pm b/lib/Module/CPANTS/Kwalitee/Version.pm
index c1c0d0b..fc3ecf9 100644
--- a/lib/Module/CPANTS/Kwalitee/Version.pm
+++ b/lib/Module/CPANTS/Kwalitee/Version.pm
@@ -2,7 +2,7 @@ package Module::CPANTS::Kwalitee::Version;
 use warnings;
 use strict;
 
-our $VERSION = '0.91';
+our $VERSION = '0.92';
 
 sub order { 100 }
 
diff --git a/xt/kwalitee/has_license_in_source_file.t b/xt/kwalitee/has_license_in_source_file.t
index 7be00bd..7c65b75 100644
--- a/xt/kwalitee/has_license_in_source_file.t
+++ b/xt/kwalitee/has_license_in_source_file.t
@@ -14,4 +14,7 @@ xt::kwalitee::Test::run(
 
   # has =head1 COPYRIGHT AND LICENSE without closing =cut
   ['D/DA/DAMI/DBIx-DataModel-2.39.tar.gz', 1],
+
+  # has =head1 LICENSE followed by =head1 COPYRIGHT
+  ['Y/YS/YSASAKI/App-pfswatch-0.08.tar.gz', 1],
 );
diff --git a/xt/strict_warnings_equiv.t b/xt/strict_warnings_equiv.t
new file mode 100644
index 0000000..72c7f38
--- /dev/null
+++ b/xt/strict_warnings_equiv.t
@@ -0,0 +1,117 @@
+use strict;
+use warnings;
+use FindBin;
+use File::Path;
+use Test::More;
+
+BEGIN {
+  plan skip_all => "This is an author test" unless $ENV{AUTHOR_TESTING};
+  plan skip_all => "requires WorePAN" unless eval { require WorePAN; WorePAN->VERSION(0.04) };
+  plan skip_all => "This doesn't run well under Windows" if $^O eq 'MSWin32';
+}
+
+use Module::CPANTS::Kwalitee::Uses;
+
+my $pid = $$;
+my $tempdir = "$FindBin::Bin/tmplib/";
+mkpath $tempdir unless -d $tempdir;
+END { rmtree $tempdir if $pid eq $$ && -d $tempdir };
+
+my %map = (
+  'Catmandu::Sane' => 'Catmandu',
+  'Mojo::Base' => 'Mojolicious',
+  'perl5i::1' => 'perl5i',
+  'perl5i::2' => 'perl5i',
+  'perl5i::latest' => 'perl5i',
+);
+
+my %flag_to_enable = (
+  'Mojo::Base' => '-base',
+  'Spiffy' => '-Base',
+);
+
+for my $module (@Module::CPANTS::Kwalitee::Uses::STRICT_EQUIV) {
+  my $res = test($module);
+  unless ($res) {
+    note "SKIP $module";
+    next;
+  }
+
+  ok $res->{strict}, "$module enforces strict";
+  ok !$res->{warnings}, "$module does not enforce warnings";
+  note;
+}
+
+for my $module (@Module::CPANTS::Kwalitee::Uses::WARNINGS_EQUIV) {
+  my $res = test($module);
+  unless ($res) {
+    note "SKIP $module";
+    next;
+  }
+
+  ok !$res->{strict}, "$module does not enforce strict";
+  ok $res->{warnings}, "$module enforces warnings";
+  note;
+}
+
+for my $module (@Module::CPANTS::Kwalitee::Uses::STRICT_WARNINGS_EQUIV) {
+  my $res = test($module);
+  unless ($res) {
+    note "SKIP $module";
+    next;
+  }
+
+  ok $res->{strict}, "$module enforces strict";
+  ok $res->{warnings}, "$module enforce warnings";
+  note;
+}
+
+sub test {
+  my $module = shift;
+  my $dist = $map{$module} || $module;
+  $dist =~ s|::|-|g;
+
+  local $Parse::PMFile::ALLOW_DEV_VERSION = 1;
+  my $worepan = WorePAN->new(
+    root => "$FindBin::Bin/tmp/",
+    dists => {$dist => 0},
+    use_backpan => 0,
+    no_network => 0,
+    verbose => 0,
+    cleanup => 1,
+  );
+  my ($version, $file) = $worepan->look_for($module);
+  $file ||= $module;
+
+  system("cpanm -nq -l $tempdir $file");
+
+  my $res = {};
+
+  {
+    open my $fh, '>', 'strict_test.pl' or die $!;
+    my $flag = $flag_to_enable{$module} || '';
+    print $fh <<"TEST_END";
+package #
+  Test::CPANTS::StrictWarningsEquiv;
+no warnings;
+my \$default_warning_bits;
+BEGIN { \$default_warning_bits = \${^WARNING_BITS}; }
+use local::lib "$tempdir";
+use $module $flag;
+BEGIN {
+print "module: $module\n";
+print "strict: ", (\$^H & (0x00000002|0x00000200|0x00000400)) ? 1 : 0, "\n";
+print "warnings: ", (\${^WARNING_BITS} ne \$default_warning_bits ? 1 : 0), "\n";
+}
+TEST_END
+    close $fh;
+
+    my $output = `$^X strict_test.pl`;
+    return if $output =~ /Can't locate/;
+    ($res->{strict}) = $output =~ /strict: ([01])/;
+    ($res->{warnings}) = $output =~ /warnings: ([01])/;
+  }
+  $res;
+}
+
+done_testing;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmodule-cpants-analyse-perl.git



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