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:
Harrison (Harry) Cramer
2023-08-31 21:36:40 -04:00
committed by GitHub
parent d92cf39dd7
commit 152c55fd57
14 changed files with 417 additions and 238 deletions

View File

@@ -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