From 18e14fee16ca2de4858dbb188174ddad34b3ef69 Mon Sep 17 00:00:00 2001 From: Greg Hurrell <7074+wincent@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:37:35 +0100 Subject: [PATCH 1/2] refactor: remove redundant conditional Removes one of the nested conditionals: ```lua if config.exclude then if config.exclude then ``` --- lua/ibl/config.lua | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lua/ibl/config.lua b/lua/ibl/config.lua index 9cc5c75..d7dcf7a 100644 --- a/lua/ibl/config.lua +++ b/lua/ibl/config.lua @@ -231,13 +231,12 @@ local validate_config = function(config) end end + if config.exclude then - if config.exclude then - utils.validate_config({ - filetypes = { config.exclude.filetypes, "table", true }, - buftypes = { config.exclude.buftypes, "table", true }, - }, config.exclude, "ibl.config.exclude") - end + utils.validate_config({ + filetypes = { config.exclude.filetypes, "table", true }, + buftypes = { config.exclude.buftypes, "table", true }, + }, config.exclude, "ibl.config.exclude") end end From c0364a650bc0ba2ad1f695f9eda3e787fa9852ce Mon Sep 17 00:00:00 2001 From: Greg Hurrell Date: Mon, 11 Nov 2024 11:07:24 +0100 Subject: [PATCH 2/2] style: run `stylua` --- lua/ibl/config.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/ibl/config.lua b/lua/ibl/config.lua index d7dcf7a..ecffebf 100644 --- a/lua/ibl/config.lua +++ b/lua/ibl/config.lua @@ -231,7 +231,6 @@ local validate_config = function(config) end end - if config.exclude then utils.validate_config({ filetypes = { config.exclude.filetypes, "table", true },