nixpkgs-lint: add check for meta.platforms attribute

This commit is contained in:
Bjørn Forsman 2013-09-02 22:13:01 +02:00
parent af96f91a12
commit decad1fc7d

View File

@ -44,6 +44,7 @@ my $info = XMLin($xml, KeyAttr => { 'item' => '+attrPath', 'meta' => 'name' }, F
print "=== Package meta information ===\n\n";
my $nrBadNames = 0;
my $nrMissingMaintainers = 0;
my $nrMissingPlatforms = 0;
my $nrMissingDescriptions = 0;
my $nrBadDescriptions = 0;
my $nrMissingLicenses = 0;
@ -77,6 +78,12 @@ foreach my $attr (sort keys %{$info->{item}}) {
$nrMissingMaintainers++;
}
# Check the platforms.
if (!defined $pkg->{meta}->{platforms}) {
print "$attr: Lacks a platform\n";
$nrMissingPlatforms++;
}
# Package names should not be capitalised.
if ($pkgName =~ /^[A-Z]/) {
print "$attr: package name $pkgName should not be capitalised\n";
@ -159,6 +166,7 @@ print "=== Bottom line ===\n";
print "Number of packages: ", scalar(keys %{$info->{item}}), "\n";
print "Number of bad names: $nrBadNames\n";
print "Number of missing maintainers: $nrMissingMaintainers\n";
print "Number of missing platforms: $nrMissingPlatforms\n";
print "Number of missing licenses: $nrMissingLicenses\n";
print "Number of missing descriptions: $nrMissingDescriptions\n";
print "Number of bad descriptions: $nrBadDescriptions\n";