From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0F7A342EF5C for ; Thu, 18 Jun 2020 12:36:32 +0300 (MSK) Date: Thu, 18 Jun 2020 12:35:07 +0300 From: Sergey Bronnikov Message-ID: <20200618093507.GC89732@pony.bronevichok.ru> References: <1d6128a1-127e-8f27-b937-c88219b3f53f@tarantool.org> <20200611120049.GA66555@pony.bronevichok.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200611120049.GA66555@pony.bronevichok.ru> Subject: Re: [Tarantool-patches] [PATCH 5/6] Fix luacheck warnings in src/lua/ List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: alexander.turenko@tarantool.org, tarantool-patches@dev.tarantool.org Hi, On 15:00 Thu 11 Jun , Sergey Bronnikov wrote: > > > diff --git a/src/lua/argparse.lua b/src/lua/argparse.lua > > > index faa0ae130..6c8f10fc1 100644 > > > --- a/src/lua/argparse.lua > > > +++ b/src/lua/argparse.lua > > > @@ -91,7 +91,8 @@ local function convert_parameter(name, convert_from, convert_to) > > > end > > > > > > local function parameters_parse(t_in, options) > > > - local t_out, t_in = {}, t_in or {} > > > + local t_out = {} > > > + t_in = t_in or {} > > > > 6. Unnecessary diff. At least when I check on top of the branch. > > change is required, see [1] > > 1. https://gitlab.com/tarantool/tarantool/-/jobs/589857153 I was wrong here, change has been reverted. > > > diff --git a/src/lua/init.lua b/src/lua/init.lua > > > index ff3e74c3c..aea7a7491 100644 > > > --- a/src/lua/init.lua > > > +++ b/src/lua/init.lua > > > @@ -144,9 +144,9 @@ local function gen_search_func(path_fn, templates, need_traverse) > > > > > > local searchpaths = {} > > > > > > - for _, path in ipairs(paths) do > > > + for _, p in ipairs(paths) do > > > for _, template in pairs(templates) do > > > - table.insert(searchpaths, fio.pathjoin(path, template)) > > > + table.insert(searchpaths, fio.pathjoin(p, template)) > > > end > > > > 7. Ditto. > > change reverted > > > > > end > > > > > > @@ -603,7 +599,7 @@ local function check_offset(offset, len) > > > if offset == nil then > > > return 1 > > > end > > > - local offset = ffi.cast('ptrdiff_t', offset) > > > + offset = ffi.cast('ptrdiff_t', offset) > > > > 8. Ditto. > > change is required, see [1] > > 1. https://gitlab.com/tarantool/tarantool/-/jobs/589857153 I was wrong here, change has been reverted. > > > if offset < 1 or offset > len then > > > error(string.format("offset = %d is out of bounds [1..%d]", > > > tonumber(offset), len)) > > > diff --git a/src/lua/socket.lua b/src/lua/socket.lua > > > index bbdef01e3..2a2c7a32c 100644 > > > --- a/src/lua/socket.lua > > > +++ b/src/lua/socket.lua > > > @@ -1044,7 +1044,7 @@ local function tcp_connect(host, port, timeout) > > > boxerrno(0) > > > return s > > > end > > > - local timeout = timeout or TIMEOUT_INFINITY > > > + timeout = timeout or TIMEOUT_INFINITY > > > > 9. Ditto. > > change is required, see [1] > > src/lua/socket.lua:344:11: variable timeout was previously defined as an argument on line 340 > > 1. https://gitlab.com/tarantool/tarantool/-/jobs/589857153 I was wrong here, change has been reverted.