Skip to content

Commit 2db3049

Browse files
authored
Merge branch 'master' into fix/help
2 parents d791de7 + 76519b5 commit 2db3049

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

changelog.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
## Unreleased
44
<!-- Add all new changes here. They will be moved under a version at release -->
5+
* `CHG` when analyzing the literal table, only the first 100 items are analyzed at most
6+
* `CHG` when checking type matching for union types, only the first 100 items are checked at most
57
* `FIX` Update `--help` message.
8+
* `FIX` --check now respects ignoreDir setting
9+
* `FIX` incorrect argument skip pattern for `--check_out_path=`, which incorrectly skips the next argument
610

711
## 3.13.7
812
`2025-3-10`

script/cli/check_worker.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function export.runCLI()
247247
local max = #uris
248248
table.sort(uris) -- sort file list to ensure the work distribution order across multiple threads
249249
for i, uri in ipairs(uris) do
250-
if (i % numThreads + 1) == threadId then
250+
if (i % numThreads + 1) == threadId and not ws.isIgnored(uri) then
251251
files.open(uri)
252252
diag.doDiagnostic(uri, true)
253253
-- Print regularly but always print the last entry to ensure

script/vm/compiler.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,10 @@ local searchFieldSwitch = util.switch()
178178
: case 'table'
179179
: call(function (_suri, source, key, pushResult)
180180
local hasFiled = false
181-
for _, field in ipairs(source) do
181+
for i, field in ipairs(source) do
182+
if i > 100 then
183+
break
184+
end
182185
if field.type == 'tablefield'
183186
or field.type == 'tableindex' then
184187
local fieldKey = guide.getKeyName(field)

script/vm/type.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,12 @@ function vm.isSubType(uri, child, parent, mark, errs)
373373
elseif child.type == 'vm.node' then
374374
if config.get(uri, 'Lua.type.weakUnionCheck') then
375375
local hasKnownType = 0
376+
local i = 0
376377
for n in child:eachObject() do
378+
i = i + 1
379+
if i > 100 then
380+
break
381+
end
377382
if vm.getNodeName(n) then
378383
local res = vm.isSubType(uri, n, parent, mark, errs)
379384
if res == true then
@@ -397,7 +402,12 @@ function vm.isSubType(uri, child, parent, mark, errs)
397402
else
398403
local weakNil = config.get(uri, 'Lua.type.weakNilCheck')
399404
local skipTable
405+
local i = 0
400406
for n in child:eachObject() do
407+
i = i + 1
408+
if i > 100 then
409+
break
410+
end
401411
if skipTable == nil and n.type == "table" and parent.type == "vm.node" then -- skip table type check if child has class
402412
---@cast parent vm.node
403413
for _, c in ipairs(child) do
@@ -462,7 +472,12 @@ function vm.isSubType(uri, child, parent, mark, errs)
462472
parent = global
463473
elseif parent.type == 'vm.node' then
464474
local hasKnownType = 0
475+
local i = 0
465476
for n in parent:eachObject() do
477+
i = i + 1
478+
if i > 100 then
479+
break
480+
end
466481
if vm.getNodeName(n) then
467482
local res = vm.isSubType(uri, child, n, mark, errs)
468483
if res == true then

0 commit comments

Comments
 (0)