mirror of
https://github.com/CompeyDev/rusty-luau.git
synced 2024-12-12 04:40:40 +00:00
chore(actions) + refactor(lint): include linting in workflow
Also fixes various lint warnings/errors by selene.
This commit is contained in:
parent
107406d50f
commit
dcbc2208c3
5 changed files with 46 additions and 36 deletions
3
.github/workflows/ci.yaml
vendored
3
.github/workflows/ci.yaml
vendored
|
@ -41,3 +41,6 @@ jobs:
|
|||
|
||||
- name: Analyze
|
||||
run: luau-lsp analyze --ignore="Packages/**" --settings=".vscode/settings.json" lib/ examples/ mod.luau
|
||||
|
||||
- name: lint
|
||||
run: selene .
|
||||
|
|
|
@ -4,3 +4,4 @@ stylua = "JohnnyMorganz/StyLua@0.20.0"
|
|||
luau-lsp = "JohnnyMorganz/luau-lsp@1.27.0"
|
||||
darklua = "seaofvoices/darklua@0.13.0"
|
||||
wally = "UpliftGames/wally@0.3.2"
|
||||
selene = "Kampfkarren/selene@0.26.1"
|
||||
|
|
|
@ -80,7 +80,7 @@ export type Future<T> = typeof(Future) & {
|
|||
_status: Status,
|
||||
}
|
||||
|
||||
local function _constructor<T>(fn: (Signal<()>, Signal<T, Status>) -> (), args: { any })
|
||||
local function _constructor<T>(fn: (Signal<()>, Signal<T, Status>) -> ())
|
||||
return setmetatable(
|
||||
{
|
||||
_thread = coroutine.create(fn),
|
||||
|
@ -115,7 +115,7 @@ function Future.new<T>(fn: (...any) -> T, args: { any })
|
|||
|
||||
local ret = fn(table.unpack(args))
|
||||
retEvt:Fire(ret, "ready")
|
||||
end, args)
|
||||
end)
|
||||
end
|
||||
|
||||
--[=[
|
||||
|
@ -132,9 +132,9 @@ function Future.try<T>(fn: (...any) -> T, args: { any })
|
|||
spawnEvt:Fire()
|
||||
|
||||
local ok, ret = pcall(fn, table.unpack(args))
|
||||
local result: Result<T, string> = if ok then Ok(ret) else Err(ret)
|
||||
retEvt:Fire(result, "ready")
|
||||
end, args)
|
||||
local res: Result<T, string> = if ok then Ok(ret) else Err(ret)
|
||||
retEvt:Fire(res, "ready")
|
||||
end)
|
||||
end
|
||||
|
||||
--[=[
|
||||
|
|
|
@ -453,7 +453,8 @@ function Result.inspectErr<T, E>(self: Result<T, E>, op: (val: E) -> ()): Result
|
|||
end
|
||||
|
||||
-- TODO: Iterator traits
|
||||
function Result.iter(): never
|
||||
-- selene: allow(unused_variable)
|
||||
function Result.iter<T, E>(self: Result<T, E>): never
|
||||
return error("Unimplemented: `Result:iter()`")
|
||||
end
|
||||
|
||||
|
@ -540,6 +541,7 @@ function Result.unwrap<T, E>(self: Result<T, E>): T | never
|
|||
end
|
||||
|
||||
-- TODO: default values for types
|
||||
-- selene: allow(unused_variable)
|
||||
function Result.unwrapOrDefault<T, E>(self: Result<T, E>): never
|
||||
return error("Unimplemented: `Result:unwrapOrDefault()`")
|
||||
end
|
||||
|
@ -596,9 +598,11 @@ function Result.unwrapErr<T, E>(self: Result<T, E>): E | never
|
|||
end
|
||||
|
||||
-- TODO: How the fuck do I implement this?
|
||||
-- selene: allow(unused_variable)
|
||||
function Result.intoOk<T, E>(self: Result<T, E>): never
|
||||
return error("Unimplemented: `Result:intoOk()`")
|
||||
end
|
||||
-- selene: allow(unused_variable)
|
||||
function Result.intoErr<T, E>(self: Result<T, E>): never
|
||||
return error("Unimplemented: `Result:intoErr()`")
|
||||
end
|
||||
|
|
2
selene.toml
Normal file
2
selene.toml
Normal file
|
@ -0,0 +1,2 @@
|
|||
std = "luau"
|
||||
exclude = ["Packages/*"]
|
Loading…
Reference in a new issue