1
0
Fork 0
mirror of https://github.com/nix-community/nixvim.git synced 2025-11-25 19:51:06 +01:00

tests/fetch-tests: only apply required args

Using `functionArgs` and `intersectAttrs`, apply only the required args
to test module files.
This commit is contained in:
Matt Sturgeon 2025-11-24 08:18:30 +00:00
parent 12fd9ee1c8
commit 824e048096
67 changed files with 71 additions and 77 deletions

View file

@ -15,7 +15,11 @@ let
cases =
if builtins.isFunction fnOrAttrs then
# Call the function
fnOrAttrs { inherit pkgs lib; }
fnOrAttrs (
builtins.intersectAttrs (builtins.functionArgs fnOrAttrs) {
inherit pkgs lib;
}
)
else
fnOrAttrs;
};

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
colorschemes.gruvbox-material-nvim.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
colorschemes.solarized-osaka.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
colorscheme = "vague";

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
"40" = {
plugins = {

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
plain = { };

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
example-with-str = {
clipboard = {

View file

@ -1,8 +1,4 @@
{
lib,
pkgs,
...
}:
{ lib, pkgs }:
let
inherit (pkgs.stdenv) hostPlatform;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
example = {
keymaps = [

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs }:
let
pluginStubs = pkgs.callPackage ../../../utils/plugin-stubs.nix { };

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs }:
let
pluginStubs = pkgs.callPackage ../../../utils/plugin-stubs.nix { };

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.actions-preview.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
theme = {
plugins.alpha = {

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.blink-indent.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, lib, ... }:
{ pkgs, lib }:
let
inherit (pkgs.stdenv) hostPlatform;
in

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.comfy-line-numbers.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs }:
{
empty = {
plugins.conform-nvim.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.coverage.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.cybu = {

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.dbee.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.fff.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.flash.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs }:
{
empty = {
plugins.gitgutter.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.gitlinker.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.gitportal.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
# TODO: remove once https://github.com/NixOS/nixpkgs/pull/418842 hits flake.lock
pkgs.lib.optionalAttrs false {
empty = {

View file

@ -1,4 +1,4 @@
{ lib, pkgs, ... }:
{ lib, pkgs }:
{
example = {
plugins.jdtls = {

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.langmapper.enable = true;

View file

@ -1,7 +1,4 @@
{
lib,
...
}:
{ lib }:
{
empty = {
plugins.leap.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.leetcode.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
empty = {
plugins.lualine.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.luau-lsp.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
empty = {
# NOTE: 2024-10-10 when marked as linux specific platform

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-bracketed.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-clue.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-comment.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-completion.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-diff.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-files.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-hipatterns.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-indentscope.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-jump2d.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-map.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-notify.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-operators.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-pick.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-sessions.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-snippets.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-splitjoin.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-starter.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-test.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.mini-visits.enable = true;

View file

@ -1,7 +1,4 @@
{
lib,
...
}:
{ lib }:
{
empty = {
plugins.multicursors.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.web-devicons.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
empty = {
plugins.neogit.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
# Fails on darwin with:
# E5113: Error while calling lua chunk: ...ckages/start/netman.nvim/lua/netman/tools/utils/init.lua:52: Unable to open netman utils cache
pkgs.lib.optionalAttrs (!pkgs.stdenv.isDarwin) {

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.showkeys.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.copilot-lua.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
empty = {
plugins.telescope = {

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.tiny-inline-diagnostic.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.todo-comments.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
default = {
plugins.treesitter = {

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.venv-selector.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.wilder.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.wtf.enable = true;

View file

@ -1,4 +1,4 @@
{ lib, ... }:
{ lib }:
{
empty = {
plugins.lsp.enable = true;

View file

@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs }:
{
# Empty configuration
empty = {