[Tarantool-patches] [PATCH 5/6] Fix luacheck warnings in src/lua/
Sergey Bronnikov
sergeyb at tarantool.org
Thu Jun 18 12:35:07 MSK 2020
Hi,
On 15:00 Thu 11 Jun , Sergey Bronnikov wrote:
<snipped>
> > > 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.
<snipped>
More information about the Tarantool-patches
mailing list