From 077489bbbfd757a309cebe9c8e160bcdc92f0fa4 Mon Sep 17 00:00:00 2001 From: garret Date: Tue, 29 Nov 2022 23:33:37 +0000 Subject: address luacheck warnings not stuff like line length (who cares) or global var stuff that it needs to work --- make-feed.lua | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/make-feed.lua b/make-feed.lua index 8f1e240..534ce28 100755 --- a/make-feed.lua +++ b/make-feed.lua @@ -21,7 +21,7 @@ local function valid_namespace(name) 1. contains _at least_ one dot 2. must **not** start or end with a dot 3. must **not** contain series of two or more dots - 4. the character set is restricted to: `A-Z`, `a-z`, `0-9`, `.`, `_`, `-` + 4. the character set is restricted to: `A-Z`, `a-z`, `0-9`, `.`, `_`, `-` __Examples__: * l0.ASSFoundation @@ -43,7 +43,7 @@ end local function join_itables(dst, src) if dst == nil then return src end if src == nil then return dst end - for i, v in ipairs(src) do + for _, v in ipairs(src) do table.insert(dst, v) end return dst @@ -100,9 +100,9 @@ local function get_files(path, are_macros) end local function get_file_metadata(file) - local sha1 = sha1.sha1(readfile(file)) + local hash = sha1.sha1(readfile(file)) local lastmodified = get_iso8601_date(lfs.attributes(file, "modification")) - return sha1, lastmodified + return hash, lastmodified end local noop = function() end @@ -270,16 +270,15 @@ local function make_feed(meta) end local function main() - local macros, modules local meta = {macros = {}, modules = {}} if args.macros then - macro_files = get_files(args.macros, true) + local macro_files = get_files(args.macros, true) for _, file in ipairs(macro_files) do table.insert(meta.macros, get_macro_metadata(file)) end end if args.modules then - module_files = get_files(args.modules) + local module_files = get_files(args.modules) for _, file in ipairs(module_files) do table.insert(meta.modules, get_module_metadata(file)) end -- cgit v1.2.3-70-g09d2