aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authordundargoc <gocdundar@gmail.com>2024-05-25 20:35:37 +0200
committerdundargoc <33953936+dundargoc@users.noreply.github.com>2024-05-27 20:48:46 +0200
commit6e8a728e3dad747d0c46dc47a530b76e8997bc08 (patch)
tree694dfdf6f734aed15c4944f8b0e8733abde802e4 /scripts
parentf70af5c3cad098ee9c7f1956bc18991cbd515507 (diff)
downloadrneovim-6e8a728e3dad747d0c46dc47a530b76e8997bc08.tar.gz
rneovim-6e8a728e3dad747d0c46dc47a530b76e8997bc08.tar.bz2
rneovim-6e8a728e3dad747d0c46dc47a530b76e8997bc08.zip
refactor: fix luals type warnings
Diffstat (limited to 'scripts')
-rw-r--r--scripts/gen_help_html.lua4
-rwxr-xr-xscripts/gen_vimdoc.lua4
-rw-r--r--scripts/luacats_parser.lua2
3 files changed, 5 insertions, 5 deletions
diff --git a/scripts/gen_help_html.lua b/scripts/gen_help_html.lua
index e238fee5f8..722efc489f 100644
--- a/scripts/gen_help_html.lua
+++ b/scripts/gen_help_html.lua
@@ -1372,7 +1372,7 @@ function M.validate(help_dir, include, parser_path)
parser_path = parser_path and vim.fn.expand(parser_path) or nil
for _, f in ipairs(helpfiles) do
- local helpfile = assert(vim.fs.basename(f))
+ local helpfile = vim.fs.basename(f)
local rv = validate_one(f, parser_path)
print(('validated (%-4s errors): %s'):format(#rv.parse_errors, helpfile))
if #rv.parse_errors > 0 then
@@ -1430,7 +1430,7 @@ end
--- :help files, we can be precise about the tolerances here.
--- @param help_dir? string e.g. '$VIMRUNTIME/doc' or './runtime/doc'
function M.test_gen(help_dir)
- local tmpdir = assert(vim.fs.dirname(vim.fn.tempname()))
+ local tmpdir = vim.fs.dirname(vim.fn.tempname())
help_dir = vim.fn.expand(help_dir or '$VIMRUNTIME/doc')
print('doc path = ' .. vim.uv.fs_realpath(help_dir))
diff --git a/scripts/gen_vimdoc.lua b/scripts/gen_vimdoc.lua
index 9c6225efc3..b88bdff99b 100755
--- a/scripts/gen_vimdoc.lua
+++ b/scripts/gen_vimdoc.lua
@@ -813,7 +813,7 @@ local function get_script_path()
end
local script_path = get_script_path()
-local base_dir = vim.fs.dirname(assert(vim.fs.dirname(script_path)))
+local base_dir = vim.fs.dirname(vim.fs.dirname(script_path))
local function delete_lines_below(doc_file, tokenstr)
local lines = {} --- @type string[]
@@ -965,7 +965,7 @@ local function gen_target(cfg)
end
end
-- FIXME: Using f_base will confuse `_meta/protocol.lua` with `protocol.lua`
- local f_base = assert(vim.fs.basename(f))
+ local f_base = vim.fs.basename(f)
sections[f_base] = make_section(f_base, cfg, briefs_txt, funs_txt)
end
diff --git a/scripts/luacats_parser.lua b/scripts/luacats_parser.lua
index cb301b32e4..66fe8ed616 100644
--- a/scripts/luacats_parser.lua
+++ b/scripts/luacats_parser.lua
@@ -458,7 +458,7 @@ local function dump_uncommitted(filename, uncommitted)
local out_path = 'luacats-uncommited/' .. filename:gsub('/', '%%') .. '.txt'
if #uncommitted > 0 then
print(string.format('Could not commit %d objects in %s', #uncommitted, filename))
- vim.fn.mkdir(assert(vim.fs.dirname(out_path)), 'p')
+ vim.fn.mkdir(vim.fs.dirname(out_path), 'p')
local f = assert(io.open(out_path, 'w'))
for i, x in ipairs(uncommitted) do
f:write(i)