diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-09-04 01:47:54 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-09-04 01:48:02 -0400 |
commit | fb660982f85daa4f21a34224fad4ad05c6f14a58 (patch) | |
tree | a8d2e4bef06b74867c2b2ed34be65e845423e88a /bin | |
parent | a8a4cbc4f8d89f9d4d5341143033a0599a07540a (diff) | |
download | conf-fb660982f85daa4f21a34224fad4ad05c6f14a58.tar.gz conf-fb660982f85daa4f21a34224fad4ad05c6f14a58.zip |
more lint
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/lint-dist | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/bin/lint-dist b/bin/lint-dist index 9ee4d53..99c8d9c 100755 --- a/bin/lint-dist +++ b/bin/lint-dist @@ -188,6 +188,38 @@ my @checks = ( ], [ sub { 1 }, + sub { !$_[0]->has_file('Changes') }, + "no Changes file" + ], + [ + sub { $_[0]->has_file('Changes') }, + sub { + require CPAN::Changes; + require version; + + my $changes = eval { + CPAN::Changes->load_string($_[0]->read_file('Changes')) + }; + + return "Couldn't parse file" unless $changes; + return "No releases" unless @{[$changes->releases]}; + + return "Invalid date format" if grep { + ($_->date // '') eq '' + } $changes->releases; + return "Invalid version format" if grep { + !version::is_lax($_->version =~ s/-TRIAL$//r) + } $changes->releases; + return "No entry for the current version" if !grep { + $_->version =~ s/-TRIAL$//r eq $_[0]->version + } $changes->releases; + + return; + }, + sub { "changelog doesn't follow the CPAN::Changes format: $_[1]" } + ], + [ + sub { 1 }, sub { my $kwalitee = $_[0]->get_json( 'http://cpants.cpanauthors.org/dist/' . $_[0]->name . '.json' @@ -292,6 +324,7 @@ package Dist::To::Lint { sub dist { shift->{dist} } sub name { shift->dist->dist } + sub version { shift->dist->version } sub distvname { shift->dist->distvname } sub lint { @{ shift->{lint} } } sub add_lint { |