plugins/none-ls: Switch from assertions to warnings for none-ls tools maintenance (#1285)

This commit is contained in:
Gaétan Lepage 2024-03-18 10:36:35 +01:00 committed by GitHub
parent 939530edca
commit a1636f620f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 (