Feat: Notes (Non-Linked Comments) (#52)
Adds support for notes. These are comments that are not linked to specific lines of code in the MR.
This commit is contained in:
committed by
GitHub
parent
d92cf39dd7
commit
152c55fd57
@@ -105,6 +105,9 @@ end
|
||||
|
||||
M.merge = function(defaults, overrides)
|
||||
local result = {}
|
||||
if type(defaults) == "table" and M.table_size(defaults) == 0 and type(overrides) == "table" then
|
||||
return overrides
|
||||
end
|
||||
|
||||
for key, value in pairs(defaults) do
|
||||
if type(value) == "table" then
|
||||
@@ -133,6 +136,15 @@ M.join = function(tbl, separator)
|
||||
return result
|
||||
end
|
||||
|
||||
M.remove_first_value = function(tbl)
|
||||
local sliced_table = {}
|
||||
for i = 2, #tbl do
|
||||
table.insert(sliced_table, tbl[i])
|
||||
end
|
||||
|
||||
return sliced_table
|
||||
end
|
||||
|
||||
M.read_file = function(file_path)
|
||||
local file = io.open(file_path, "r")
|
||||
if file == nil then
|
||||
@@ -166,6 +178,12 @@ M.join_tables = function(table1, table2)
|
||||
return table1
|
||||
end
|
||||
|
||||
M.table_size = function(t)
|
||||
local count = 0
|
||||
for _ in pairs(t) do count = count + 1 end
|
||||
return count
|
||||
end
|
||||
|
||||
M.contains = function(array, search_value)
|
||||
for _, value in ipairs(array) do
|
||||
if value == search_value then
|
||||
|
||||
Reference in New Issue
Block a user