chore: enable incomplete-signature-doc, format nvt-min.lua, assorted formatting tidies (#2967)

* chore: luacheckrc uses table

* chore: format nvt-min.lua

* chore: complete lua doc

* chore: complete lua doc

* chore: complete lua doc

* chore: complete lua doc

* chore: complete lua doc

* chore: enable incomplete-signature-doc

* chore: enable incomplete-signature-doc

* chore: complete lua doc

* chore: complete lua doc
This commit is contained in:
Alexander Courtis
2024-10-25 14:25:30 +11:00
committed by GitHub
parent 68be6df2fc
commit 077af9f990
17 changed files with 54 additions and 33 deletions

View File

@@ -25,7 +25,8 @@ function M.fn(should_close)
local parent = (node:get_parent_of_group() or node).parent
if not parent or not parent.parent then
return view.set_cursor({ 1, 0 })
view.set_cursor({ 1, 0 })
return
end
local _, line = utils.find_node(parent.explorer.nodes, function(n)

View File

@@ -369,6 +369,7 @@ end
---@param mode string
---@param filename string
---@return nil
function M.fn(mode, filename)
if type(mode) ~= "string" then
mode = ""

View File

@@ -30,15 +30,18 @@ end
---@param node Node
---@return boolean
local function should_expand(expansion_count, node)
local dir = node:as(DirectoryNode)
if not dir then
return false
end
local should_halt = expansion_count >= M.MAX_FOLDER_DISCOVERY
local should_exclude = M.EXCLUDE[node.name]
return not should_halt and node.nodes and not node.open and not should_exclude
local should_exclude = M.EXCLUDE[dir.name]
return not should_halt and not dir.open and not should_exclude
end
local function gen_iterator()
local expansion_count = 0
---@param parent DirectoryNode
return function(parent)
if parent.parent and parent.nodes and not parent.open then
expansion_count = expansion_count + 1
@@ -47,14 +50,15 @@ local function gen_iterator()
Iterator.builder(parent.nodes)
:hidden()
---@param node DirectoryNode
:applier(function(node)
if should_expand(expansion_count, node) then
expansion_count = expansion_count + 1
expand(node)
node = node:as(DirectoryNode)
if node then
expand(node)
end
end
end)
---@param node DirectoryNode
:recursor(function(node)
return expansion_count < M.MAX_FOLDER_DISCOVERY and (node.group_next and { node.group_next } or (node.open and node.nodes))
end)