Skip to content

More flags for metrics, to allow easier skipping #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Module/CPANTS/Kwalitee/Distname.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down
5 changes: 4 additions & 1 deletion lib/Module/CPANTS/Kwalitee/Files.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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},
},
{
Expand All @@ -213,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};
Expand Down Expand Up @@ -275,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;
Expand Down
1 change: 1 addition & 0 deletions lib/Module/CPANTS/Kwalitee/Manifest.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
}
];
Expand Down