From daa3dfaeb7fe6d9674d3113ab92959ad0175c2b9 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 14 Mar 2017 01:54:33 +1100 Subject: [PATCH] Fix luacheck warnings A recent luacheck update added new warnings. --- luatz/parse.lua | 2 +- luatz/strftime.lua | 3 ++- luatz/tzfile.lua | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/luatz/parse.lua b/luatz/parse.lua index 0bfd820..648d538 100644 --- a/luatz/parse.lua +++ b/luatz/parse.lua @@ -6,7 +6,7 @@ local new_timetable = require "luatz.timetable".new -- If the timestamp is only partial (i.e. missing "Z" or time offset) then `tz_offset` will be nil -- TODO: Validate components are within their boundarys (e.g. 1 <= month <= 12) local function rfc_3339 ( str , init ) - local year , month , day , hour , min , sec , patt_end = str:match ( "^(%d%d%d%d)%-(%d%d)%-(%d%d)[Tt](%d%d%.?%d*):(%d%d):(%d%d)()" , init ) + local year , month , day , hour , min , sec , patt_end = str:match ( "^(%d%d%d%d)%-(%d%d)%-(%d%d)[Tt](%d%d%.?%d*):(%d%d):(%d%d)()" , init ) -- luacheck: ignore 631 if not year then return nil, "Invalid RFC 3339 timestamp" end diff --git a/luatz/strftime.lua b/luatz/strftime.lua index b82c22b..a65a706 100644 --- a/luatz/strftime.lua +++ b/luatz/strftime.lua @@ -8,7 +8,8 @@ local c_locale = { abday = { "Sun" , "Mon" , "Tue" , "Wed" , "Thu" , "Fri" , "Sat" } ; day = { "Sunday" , "Monday" , "Tuesday" , "Wednesday" , "Thursday" , "Friday" , "Saturday" } ; abmon = { "Jan" , "Feb" , "Mar" , "Apr" , "May" , "Jun" , "Jul" , "Aug" , "Sep" , "Oct" , "Nov" , "Dec" } ; - mon = { "January" , "February" , "March" , "April" , "May" , "June" , "July" , "August" , "September" , "October" , "November" , "December" } ; + mon = { "January" , "February" , "March" , "April" , "May" , "June" , + "July" , "August" , "September" , "October" , "November" , "December" } ; am_pm = { "AM" , "PM" } ; } diff --git a/luatz/tzfile.lua b/luatz/tzfile.lua index 9603cfc..2d64d36 100644 --- a/luatz/tzfile.lua +++ b/luatz/tzfile.lua @@ -3,7 +3,9 @@ local tt_info_mt = require "luatz.tzinfo".tt_info_mt local read_int32be, read_int64be -if string.unpack then -- Only available in Lua 5.3+ +-- luacheck: push std max +if string.unpack then + -- Only available in Lua 5.3+ function read_int32be(fd) local data, err = fd:read(4) if data == nil then return nil, err end @@ -15,7 +17,7 @@ if string.unpack then -- Only available in Lua 5.3+ if data == nil then return nil, err end return string.unpack(">i8", data) end -else +else -- luacheck: pop function read_int32be(fd) local data, err = fd:read(4) if data == nil then return nil, err end -- 2.39.5