Skip to content

Commit

Permalink
tests: add check for nixpkgs maintainers
Browse files Browse the repository at this point in the history
The test fails if a nixvim maintainer is also a nixpkgs maintainer.
  • Loading branch information
MattSturgeon committed Jul 10, 2024
1 parent 497ce47 commit 34c3c02
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions flake-modules/tests.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
inherit pkgs helpers;
inherit (pkgs) lib;
};

maintainers = import ../tests/maintainers.nix { inherit pkgs; };
};
};
}
21 changes: 21 additions & 0 deletions tests/maintainers.nix
Original file line number Diff line number Diff line change
@@ -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
''

0 comments on commit 34c3c02

Please sign in to comment.