Update tooling and fix analyze

This commit is contained in:
Filip Tibell 2025-04-28 21:57:45 +02:00
parent 18f58692e3
commit e79ffc11a5
No known key found for this signature in database
14 changed files with 35 additions and 14 deletions

5
.gitignore vendored
View file

@ -21,7 +21,12 @@ lune.yml
luneDocs.json
luneTypes.d.luau
# Dirs generated by runtime or build scripts
/types
# Files generated by runtime or build scripts
scripts/brick_color.rs
scripts/font_enum_map.rs
scripts/physical_properties_enum_map.rs

View file

@ -65,6 +65,7 @@ fmt-check:
analyze:
#!/usr/bin/env bash
set -euo pipefail
lune run scripts/analyze_copy_typedefs
luau-lsp analyze \
--settings=".vscode/settings.json" \
--ignore="tests/roblox/rbx-test-files/**" \

View file

@ -32,6 +32,6 @@ print(`Listening on port {PORT} 🚀`)
task.delay(10, function()
print("Shutting down...")
task.wait(1)
handle:stop()
handle.stop()
task.wait(1)
end)

View file

@ -1,4 +1,5 @@
[tools]
luau-lsp = "JohnnyMorganz/luau-lsp@1.33.1"
stylua = "JohnnyMorganz/StyLua@0.20.0"
just = "casey/just@1.36.0"
luau-lsp = "JohnnyMorganz/luau-lsp@1.44.1"
lune = "lune-org/lune@0.9.0"
stylua = "JohnnyMorganz/StyLua@2.1.0"
just = "casey/just@1.40.0"

View file

@ -0,0 +1,14 @@
local fs = require("@lune/fs")
fs.writeDir("./types")
for _, dir in fs.readDir("./crates") do
local std = string.match(dir, "^lune%-std%-(%w+)$")
if std ~= nil then
local from = `./crates/{dir}/types.d.luau`
if fs.isFile(from) then
local to = `./types/{std}.luau`
fs.copy(from, to, true)
end
end
end

View file

@ -28,7 +28,7 @@ local handle = net.serve(PORT, function()
end)
task.delay(0.25, function()
handle:stop()
handle.stop()
end)
test(net.serve, PORT, function() end)

View file

@ -19,7 +19,7 @@ local handle = net.serve(PORT, {
local response = net.request(`{LOCALHOST}:{PORT}`).body
assert(response ~= nil, "Invalid response from server")
handle:stop()
handle.stop()
-- Attempting to serve with a malformed IP address should throw an error

View file

@ -12,7 +12,7 @@ end)
-- Stopping is not guaranteed to happen instantly since it is async, but
-- it should happen on the next yield, so we wait the minimum amount here
handle:stop()
handle.stop()
task.wait()
-- Sending a request to the stopped server should now error

View file

@ -21,4 +21,4 @@ end)
task.cancel(thread)
handle:stop()
handle.stop()

View file

@ -42,4 +42,4 @@ end
task.cancel(thread)
handle:stop()
handle.stop()

View file

@ -64,4 +64,4 @@ assert(
)
-- Stop the server to end the test
handle:stop()
handle.stop()

View file

@ -10,7 +10,7 @@ local echoResult = process.exec("echo", {
}, {
env = { TEST_VAR = echoMessage },
shell = if IS_WINDOWS then "powershell" else "bash",
stdio = "inherit" :: process.SpawnOptionsStdioKind, -- FIXME: This should just work without a cast?
stdio = "inherit",
})
-- Windows uses \r\n (CRLF) and unix uses \n (LF)

View file

@ -1,10 +1,10 @@
local inner = require("@self/module")
local inner = require("@self/module") :: any -- FIXME: luau-lsp does not yet support self alias
local outer = require("./module")
assert(type(outer) == "table", "Outer module is not a table")
assert(type(inner) == "table", "Inner module is not a table")
assert(outer.Foo == inner.Foo, "Outer and inner modules have different Foo values")
assert(inner.Bar == outer.Bar, "Outer and inner modules have different Bar values")
assert(inner.Hello == outer.Hello, "Outer and inner modules have different Hello values")
return inner

View file

@ -7,7 +7,7 @@ local objValue1 = Instance.new("ObjectValue")
local objValue2 = Instance.new("ObjectValue")
objValue1.Name = "ObjectValue1"
objValue2.Name = "ObjectValue2";
objValue2.Name = "ObjectValue2"
(objValue1 :: any).Value = root;
(objValue2 :: any).Value = child
objValue1.Parent = child