tests: add check for nixpkgs maintainers

The test fails if a nixvim maintainer is also a nixpkgs maintainer.
This commit is contained in:
Matt Sturgeon 2024-07-09 15:11:29 +01:00
parent 497ce47593
commit 34c3c026b4
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
2 changed files with 23 additions and 0 deletions

View file

@ -44,6 +44,8 @@
inherit pkgs helpers;
inherit (pkgs) lib;
};
maintainers = import ../tests/maintainers.nix { inherit pkgs; };
};
};
}

21
tests/maintainers.nix Normal file
View file

@ -0,0 +1,21 @@
{
pkgs ? import <nixpkgs> { },
lib ? pkgs.lib,
}:
let
inherit (lib) attrNames filter length;
nixvimList = import ../lib/maintainers.nix;
nixpkgsList = lib.maintainers;
duplicates = filter (name: nixpkgsList ? ${name}) (attrNames nixvimList);
count = length duplicates;
in
pkgs.runCommand "maintainers-test" { inherit count duplicates; } ''
if [ $count -gt 0 ]; then
echo "$count nixvim maintainers are also nixpkgs maintainers:"
for name in $duplicates; do
echo "- $name"
done
exit 1
fi
touch $out
''