summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-09-04 01:47:54 -0400
committerJesse Luehrs <doy@tozt.net>2013-09-04 01:48:02 -0400
commitfb660982f85daa4f21a34224fad4ad05c6f14a58 (patch)
treea8d2e4bef06b74867c2b2ed34be65e845423e88a /bin
parenta8a4cbc4f8d89f9d4d5341143033a0599a07540a (diff)
downloadconf-fb660982f85daa4f21a34224fad4ad05c6f14a58.tar.gz
conf-fb660982f85daa4f21a34224fad4ad05c6f14a58.zip
more lint
Diffstat (limited to 'bin')
-rwxr-xr-xbin/lint-dist33
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 {