From c228908ffc485ee01a5ac118e23e13ce3d19cbf9 Mon Sep 17 00:00:00 2001 From: Folke Lemaitre Date: Wed, 21 Dec 2022 16:07:49 +0100 Subject: [PATCH] fix(health): don't show warning on `module=false` --- README.md | 1 + lua/lazy/health.lua | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f3c8d25..e8faab1 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ require("lazy").setup({ | **cmd** | `string?` or `string[]` | Lazy-load on command | | **ft** | `string?` or `string[]` | Lazy-load on filetype | | **keys** | `string?` or `string[]` | Lazy-load on key mapping | +| **module** | `false?` | Do not automatically load this lua module when it's required somewhere | ### Lazy Loading diff --git a/lua/lazy/health.lua b/lua/lazy/health.lua index d749903..88d5b23 100644 --- a/lua/lazy/health.lua +++ b/lua/lazy/health.lua @@ -37,6 +37,7 @@ function M.check() "tag", "commit", "version", + "module", "pin", "cmd", "event", @@ -48,7 +49,9 @@ function M.check() for _, plugin in pairs(Config.plugins) do for key in pairs(plugin) do if not vim.tbl_contains(valid, key) then - vim.health.report_warn("{" .. plugin.name .. "}: unknown key <" .. key .. ">") + if key ~= "module" or type(plugin.module) ~= "boolean" then + vim.health.report_warn("{" .. plugin.name .. "}: unknown key <" .. key .. ">") + end end end end