aboutsummaryrefslogtreecommitdiffstats
path: root/lua/mason-core/managers/luarocks/init.lua
diff options
context:
space:
mode:
authorWilliam Boman <william@redwill.se>2022-08-15 21:03:06 +0200
committerGitHub <noreply@github.com>2022-08-15 21:03:06 +0200
commit3c62386a396ae0c1cd7adbaacc379eb4af072a65 (patch)
tree4d00d20958839a04e6a996c11b97724c762e491a /lua/mason-core/managers/luarocks/init.lua
parentchore: update generated code (#295) (diff)
downloadmason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.gz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.bz2
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.lz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.xz
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.tar.zst
mason-3c62386a396ae0c1cd7adbaacc379eb4af072a65.zip
refactor: introduce selene, harden type defs, and use proper EmmyLua syntax (#296)
Diffstat (limited to 'lua/mason-core/managers/luarocks/init.lua')
-rw-r--r--lua/mason-core/managers/luarocks/init.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/lua/mason-core/managers/luarocks/init.lua b/lua/mason-core/managers/luarocks/init.lua
index 9fd59ca1..81d9ae89 100644
--- a/lua/mason-core/managers/luarocks/init.lua
+++ b/lua/mason-core/managers/luarocks/init.lua
@@ -20,8 +20,8 @@ local function with_receipt(package)
end
end
----@param package string: The luarock package to install.
----@param opts { dev: boolean?, server: string?, bin : string[]? | nil }?
+---@param package string The luarock package to install.
+---@param opts { dev: boolean?, server: string?, bin: string[]? }?
function M.package(package, opts)
return function()
return M.install(package, opts).with_receipt()
@@ -30,7 +30,7 @@ end
---@async
---@param pkg string: The luarock package to install.
----@param opts { dev: boolean?, server: string?, bin : string[]? | nil }?
+---@param opts { dev: boolean?, server: string?, bin: string[]? }?
function M.install(pkg, opts)
opts = opts or {}
local ctx = installer.context()
@@ -67,7 +67,7 @@ M.parse_installed_rocks = _.compose(
)
---@async
----@param receipt InstallReceipt
+---@param receipt InstallReceipt<InstallReceiptPackageSource>
---@param install_dir string
function M.get_installed_primary_package_version(receipt, install_dir)
if receipt.primary_source.type ~= "luarocks" then
@@ -102,7 +102,7 @@ M.parse_outdated_rocks = _.compose(
)
---@async
----@param receipt InstallReceipt
+---@param receipt InstallReceipt<InstallReceiptPackageSource>
---@param install_dir string
function M.check_outdated_primary_package(receipt, install_dir)
if receipt.primary_source.type ~= "luarocks" then
@@ -125,8 +125,8 @@ function M.check_outdated_primary_package(receipt, install_dir)
function(outdated_rock)
return {
name = outdated_rock.name,
- current_version = assert(outdated_rock.installed),
- latest_version = assert(outdated_rock.available),
+ current_version = assert(outdated_rock.installed, "missing installed luarock version"),
+ latest_version = assert(outdated_rock.available, "missing available luarock version"),
}
end
)