From 1b068c1d33641f7351f293134f6a685ce6329ac6 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Thu, 18 Jul 2013 10:15:04 -0700 Subject: [PATCH 1/3] new metric flag "needs_tarball", for tests that only work when we have a dist.tar.gz to work with --- lib/Module/CPANTS/Kwalitee/Distname.pm | 2 ++ lib/Module/CPANTS/Kwalitee/Files.pm | 2 ++ lib/Module/CPANTS/Kwalitee/Manifest.pm | 1 + 3 files changed, 5 insertions(+) diff --git a/lib/Module/CPANTS/Kwalitee/Distname.pm b/lib/Module/CPANTS/Kwalitee/Distname.pm index 2788403..1fb7b2b 100644 --- a/lib/Module/CPANTS/Kwalitee/Distname.pm +++ b/lib/Module/CPANTS/Kwalitee/Distname.pm @@ -56,12 +56,14 @@ sub kwalitee_indicators { name=>'has_version', error=>"The package filename (eg. Foo-Bar-1.42.tar.gz) does not include a version number (or something that looks like a reasonable version number to CPAN::DistnameInfo)", remedy=>q{Add a version number to the packed distribution. Or use a buildtool ('make dist' or 'Build dist')}, + needs_tarball=>1, code=>sub { shift->{version} ? 1 : 0 } }, { name=>'has_proper_version', error=>"The version number isn't a number. It probably contains letter besides a leading 'v', which it shouldn't", remedy=>q{Remove all letters from the version number. If you want to mark a release as a developer release, use the scheme 'Module-1.00_01'}, + needs_tarball=>1, code=>sub { my $v=shift->{version}; return 0 unless $v; return 1 if ($v=~ /\A v? \d+ (?:\.\d+)* (?:_\d+)? (\-TRIAL)?\z/xi ); diff --git a/lib/Module/CPANTS/Kwalitee/Files.pm b/lib/Module/CPANTS/Kwalitee/Files.pm index 5e2bd09..8ac468d 100644 --- a/lib/Module/CPANTS/Kwalitee/Files.pm +++ b/lib/Module/CPANTS/Kwalitee/Files.pm @@ -184,12 +184,14 @@ sub kwalitee_indicators { name=>'extractable', error=>q{This package uses an unknown packaging format. CPANTS can handle tar.gz, tgz and zip archives. No kwalitee metrics have been calculated.}, remedy=>q{Pack the distribution with tar & gzip or zip.}, + needs_tarball=>1, code=>sub { shift->{extractable} ? 1 : -100 }, }, { name=>'extracts_nicely', error=>q{This package doesn't create a directory and extracts its content into this directory. Instead, it spews its content into the current directory, making it really hard/annoying to remove the unpacked package.}, remedy=>q{Issue the command to pack the distribution in the directory above it. Or use a buildtool ('make dist' or 'Build dist')}, + needs_tarball=>1, code=>sub { shift->{extracts_nicely} ? 1 : 0}, }, { diff --git a/lib/Module/CPANTS/Kwalitee/Manifest.pm b/lib/Module/CPANTS/Kwalitee/Manifest.pm index c5ac127..c9f89f8 100644 --- a/lib/Module/CPANTS/Kwalitee/Manifest.pm +++ b/lib/Module/CPANTS/Kwalitee/Manifest.pm @@ -72,6 +72,7 @@ sub kwalitee_indicators { name=>'manifest_matches_dist', error=>q{MANIFEST does not match the contents of this distribution. See 'error_manifest_matches_dist' in the dist view for more info.}, remedy=>q{Use a buildtool to generate the MANIFEST. Or update MANIFEST manually.}, + needs_tarball=>1, code=>sub { shift->{manifest_matches_dist} ? 1 : 0 }, } ]; From 8759dd0c88ff3835a3feee3a31c65000458b77e9 Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Thu, 18 Jul 2013 10:20:18 -0700 Subject: [PATCH 2/3] new metric flag "no_build", for tests that only work before we build the dist --- lib/Module/CPANTS/Kwalitee/Files.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Module/CPANTS/Kwalitee/Files.pm b/lib/Module/CPANTS/Kwalitee/Files.pm index 8ac468d..ca268dd 100644 --- a/lib/Module/CPANTS/Kwalitee/Files.pm +++ b/lib/Module/CPANTS/Kwalitee/Files.pm @@ -277,6 +277,7 @@ sub kwalitee_indicators { name=>'no_generated_files', error=>q{This distribution has a file that should be generated at build time, not distributed by the author.}, remedy=>q{Remove the offending file!}, + no_build=>1, code=>sub { my $d=shift; #die Dumper \%generated_db_files; From 75fea3caac6185b7cbd6118316a3010008e340ef Mon Sep 17 00:00:00 2001 From: Karen Etheridge Date: Thu, 25 Jul 2013 13:25:31 -0700 Subject: [PATCH 3/3] spelling fix --- lib/Module/CPANTS/Kwalitee/Files.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Module/CPANTS/Kwalitee/Files.pm b/lib/Module/CPANTS/Kwalitee/Files.pm index ca268dd..b0a89e0 100644 --- a/lib/Module/CPANTS/Kwalitee/Files.pm +++ b/lib/Module/CPANTS/Kwalitee/Files.pm @@ -215,7 +215,7 @@ sub kwalitee_indicators { { name=>'has_buildtool', error=>q{Makefile.PL and/or Build.PL are missing. This makes installing this distribution hard for humans and impossible for automated tools like CPAN/CPANPLUS}, - remedy=>q{Use a buildtool like Module::Build (recomended) or ExtUtils::MakeMaker to manage your distribution}, + remedy=>q{Use a buildtool like Module::Build (recommended) or ExtUtils::MakeMaker to manage your distribution}, code=>sub { my $d=shift; return 1 if $d->{file_makefile_pl} || $d->{file_build_pl};