From a1636f620f3e34ee6fd06cfa9e61b2db72be1205 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=A9tan=20Lepage?= <33058747+GaetanLepage@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:36:35 +0100 Subject: [PATCH] plugins/none-ls: Switch from assertions to warnings for none-ls tools maintenance (#1285) --- plugins/none-ls/servers.nix | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/plugins/none-ls/servers.nix b/plugins/none-ls/servers.nix index 86c1fee1..b2c3b371 100644 --- a/plugins/none-ls/servers.nix +++ b/plugins/none-ls/servers.nix @@ -299,7 +299,7 @@ in { mkIf cfg.enable { # ASSERTIONS FOR DEVELOPMENT PURPOSES: Any failure should be caught by CI before deployment. # Ensure that the keys of the manually declared `builtinPackages` match the ones from upstream. - assertions = let + warnings = let upstreamToolNames = unique ( flatten ( @@ -321,22 +321,23 @@ in { # Keep tool names which are not in upstream (toolName: !(elem toolName upstreamToolNames)) localToolNames; - in [ - { - assertion = (length undeclaredToolNames) == 0; - message = '' - Nixvim (plugins.none-ls): Some tools from upstream are not declared locally in `builtinPackages`. + in + ( + optional + ((length undeclaredToolNames) > 0) + '' + [DEV] Nixvim (plugins.none-ls): Some tools from upstream are not declared locally in `builtinPackages`. -> [${concatStringsSep ", " undeclaredToolNames}] - ''; - } - { - assertion = (length uselesslyDeclaredToolNames) == 0; - message = '' - Nixvim (plugins.none-ls): Some tools are declared locally but are not in the upstream list of supported plugins. + '' + ) + ++ ( + optional + ((length uselesslyDeclaredToolNames) > 0) + '' + [DEV] Nixvim (plugins.none-ls): Some tools are declared locally but are not in the upstream list of supported plugins. -> [${concatStringsSep ", " uselesslyDeclaredToolNames}] - ''; - } - ]; + '' + ); plugins.none-ls.sourcesItems = builtins.map (