From 3f531c362d07d52c4956520e3798e9cfb5aeabdf Mon Sep 17 00:00:00 2001 From: pysan3 Date: Sun, 19 Nov 2023 17:49:59 +0900 Subject: [PATCH] fix(typecheck): fix type errors caused by autoformat --- lua/neorg/modules/core/export/module.lua | 14 +++++++------- lua/neorg/modules/core/keybinds/module.lua | 4 ++-- lua/neorg/modules/core/tangle/module.lua | 8 ++++---- lua/neorg/modules/core/upgrade/module.lua | 8 ++++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/lua/neorg/modules/core/export/module.lua b/lua/neorg/modules/core/export/module.lua index 79ba4b23d..ee9457a71 100644 --- a/lua/neorg/modules/core/export/module.lua +++ b/lua/neorg/modules/core/export/module.lua @@ -224,17 +224,17 @@ module.on_event = function(event) local exported = module.public.export(event.buffer, filetype) ---@diagnostic disable-line -- TODO: type error workaround vim.loop.fs_open( - filepath, + filepath, ---@diagnostic disable-line -- TODO: type error workaround "w", 438, - function(err, fd) ---@diagnostic disable-line -- TODO: type error workaround + function(err, fd) assert(not err, lib.lazy_string_concat("Failed to open file '", filepath, "' for export: ", err)) vim.loop.fs_write( - fd, - exported, + fd, ---@diagnostic disable-line -- TODO: type error workaround + exported, ---@diagnostic disable-line -- TODO: type error workaround 0, - function(werr) ---@diagnostic disable-line -- TODO: type error workaround + function(werr) assert( not werr, lib.lazy_string_concat("Failed to write to file '", filepath, "' for export: ", werr) @@ -310,10 +310,10 @@ module.on_event = function(event) ) vim.loop.fs_write( - fd, + fd, ---@diagnostic disable-line -- TODO: type error workaround exported, 0, - function(werr) ---@diagnostic disable-line -- TODO: type error workaround + function(werr) assert( not werr, lib.lazy_string_concat( diff --git a/lua/neorg/modules/core/keybinds/module.lua b/lua/neorg/modules/core/keybinds/module.lua index b250f38df..2b6ff515f 100644 --- a/lua/neorg/modules/core/keybinds/module.lua +++ b/lua/neorg/modules/core/keybinds/module.lua @@ -74,9 +74,9 @@ module.load = function() module.required["core.autocommands"].enable_autocommand("BufLeave") if module.config.public.hook then - neorg.callbacks.on_event( + neorg.callbacks.on_event( ---@diagnostic disable-line -- TODO: type error workaround "core.keybinds.events.enable_keybinds", - function(_, keybinds) ---@diagnostic disable-line -- TODO: type error workaround + function(_, keybinds) module.config.public.hook(keybinds) end ) diff --git a/lua/neorg/modules/core/tangle/module.lua b/lua/neorg/modules/core/tangle/module.lua index ad148bac5..13dbffaa8 100644 --- a/lua/neorg/modules/core/tangle/module.lua +++ b/lua/neorg/modules/core/tangle/module.lua @@ -430,18 +430,18 @@ module.on_event = function(event) for file, content in pairs(tangles) do vim.loop.fs_open( - vim.fn.expand(file), + vim.fn.expand(file), ---@diagnostic disable-line -- TODO: type error workaround "w", 438, - function(err, fd) ---@diagnostic disable-line -- TODO: type error workaround + function(err, fd) file_count = file_count - 1 assert(not err, lib.lazy_string_concat("Failed to open file '", file, "' for tangling: ", err)) vim.loop.fs_write( - fd, + fd, ---@diagnostic disable-line -- TODO: type error workaround table.concat(content, "\n"), 0, - function(werr) ---@diagnostic disable-line -- TODO: type error workaround + function(werr) assert( not werr, lib.lazy_string_concat("Failed to write to file '", file, "' for tangling: ", werr) diff --git a/lua/neorg/modules/core/upgrade/module.lua b/lua/neorg/modules/core/upgrade/module.lua index 49987a5f8..8cb172de7 100644 --- a/lua/neorg/modules/core/upgrade/module.lua +++ b/lua/neorg/modules/core/upgrade/module.lua @@ -254,10 +254,10 @@ module.on_event = function(event) assert(not err, lib.lazy_string_concat("Failed to open file '", path, "' for upgrade: ", err)) vim.loop.fs_write( - fd, + fd, ---@diagnostic disable-line -- TODO: type error workaround output, 0, - function(werr) ---@diagnostic disable-line -- TODO: type error workaround + function(werr) assert( not werr, lib.lazy_string_concat("Failed to write to file '", path, "' for upgrade: ", werr) @@ -372,10 +372,10 @@ module.on_event = function(event) ) vim.loop.fs_write( - fd, + fd, ---@diagnostic disable-line -- TODO: type error workaround output, 0, - function(werr) ---@diagnostic disable-line -- TODO: type error workaround + function(werr) assert( not werr, lib.lazy_string_concat(