Module:Module introspection: Difference between revisions

Ganaram inukshuk (talk | contribs)
bugfix false positives from arguments
Ganaram inukshuk (talk | contribs)
mNo edit summary
Line 13: Line 13:
-- - If neither function exists, then the module is a metamodule, a module that
-- - If neither function exists, then the module is a metamodule, a module that
--  generally provides functionality to other modules.
--  generally provides functionality to other modules.


-- Inspects a module for its functions, its dependencies, and the functions used
-- Inspects a module for its functions, its dependencies, and the functions used
-- from those dependencies.
-- from those dependencies.


-- CURRENT BUGS:
-- CURRENT BUGS DEEMED NON-ISSUES AT TIME OF WRITING:
-- If strings contain actual code, they will be treated as part of the code.
-- If strings contain actual code, they will be treated as part of the code.
-- This should be a non-issue as long as no module adds any actual code, or if
-- This should be a non-issue as long as no module adds any actual code, or if
-- it does, it's broken into enough pieces that it won't be detected as proper
-- it does, it's broken into enough pieces that it won't be detected as proper
-- code. This is currently a non-issue since no modules (currently) have code
-- code. This is considered a non-issue since no modules (currently) have code
-- in strings.
-- in strings. (This one did at one point, but only for testing purposes)


-- Helper function
-- Helper function
Line 177: Line 176:
local lines = {}
local lines = {}
table.insert(lines, '{| class="wikitable sortable"')
table.insert(lines, '{| class="wikitable sortable"')
table.insert(lines, "|+ Modules used " .. string.format("(%d)", num_deps))
table.insert(lines, "|+ Lua modules used " .. string.format("(%d)", num_deps))
table.insert(lines, "! Variable")
table.insert(lines, "! Variable")
table.insert(lines, "! Module")
table.insert(lines, "! Module")
Line 265: Line 264:
local combined_tables = table.concat({
local combined_tables = table.concat({
'{| class="wikitable mw-collapsible"',
'{| class="wikitable mw-collapsible"',
'! colspan="2" | Introspection summary for Module:' .. module_name,
'! colspan="2" | Introspection summary for Module:' .. module_name .. " ",
"|-",
"|-",
'| style="vertical-align:top; border-right:none"; |',
'| style="vertical-align:top; border-right:none"; |',