[Tarantool-patches] [PATCH v5 07/10] Fix luacheck warnings in src/box/lua/

Igor Munkin imun at tarantool.org
Wed May 27 19:54:31 MSK 2020


Sergey,

Thanks, the patch LGTM except several nits I left below.

On 12.05.20, sergeyb at tarantool.org wrote:
> From: Sergey Bronnikov <sergeyb at tarantool.org>
> 
> Closes #4681
> 
> Reviewed-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
> Co-authored-by: Vladislav Shpilevoy <v.shpilevoy at tarantool.org>
> ---
>  src/box/lua/console.lua         |  6 ++--
>  src/box/lua/feedback_daemon.lua |  2 +-
>  src/box/lua/key_def.lua         |  2 +-
>  src/box/lua/load_cfg.lua        | 31 ++++++++++---------
>  src/box/lua/net_box.lua         | 53 +++++++++++++--------------------
>  src/box/lua/schema.lua          | 50 +++++++++++++++----------------
>  src/box/lua/tuple.lua           |  8 ++---
>  src/box/lua/upgrade.lua         | 19 ++++++------
>  8 files changed, 78 insertions(+), 93 deletions(-)
> 

<snipped>

> diff --git a/src/box/lua/net_box.lua b/src/box/lua/net_box.lua
> index 9560bfdd4..3f2a9df81 100644
> --- a/src/box/lua/net_box.lua
> +++ b/src/box/lua/net_box.lua

<snipped>

> @@ -253,7 +249,7 @@ local function on_push_sync_default(...) end
>  --
>  -- The following events are delivered, with arguments:
>  --
> ---  'state_changed', state, errno, error
> +--  'state_changed', state, errno

Typo: s/errno/error/ since you removed the third argument.

>  --  'handshake', greeting -> nil (accept) / errno, error (reject)
>  --  'will_fetch_schema'   -> true (approve) / false (skip fetch)
>  --  'did_fetch_schema', schema_version, spaces, indices

<snipped>

> @@ -795,13 +791,12 @@ local function create_transport(host, port, user, password, callback,
>              return iproto_schema_sm()
>          end
>          encode_auth(send_buf, new_request_id(), user, password, salt)
> -        local err, hdr, body_rpos, body_end = send_and_recv_iproto()
> +        local err, hdr, body_rpos = send_and_recv_iproto()
>          if err then
>              return error_sm(err, hdr)
>          end
>          if hdr[IPROTO_STATUS_KEY] ~= 0 then
> -            local body
> -            body, body_end = decode(body_rpos)
> +            local body, _ = decode(body_rpos)

Underscore variable is excess here (see v4 review[1]).

>              return error_sm(E_NO_CONNECTION, body[IPROTO_ERROR_24])
>          end
>          set_state('fetch_schema')
> @@ -852,8 +847,7 @@ local function create_transport(host, port, user, password, callback,
>                          peer_has_vcollation = false
>                          goto continue
>                      end
> -                    local body
> -                    body, body_end = decode(body_rpos)
> +                    local body, _ = decode(body_rpos)

Underscore variable is excess here (see v4 review[1]).

>                      return error_sm(E_NO_CONNECTION, body[IPROTO_ERROR_24])
>                  end
>                  if schema_version == nil then

<snipped>

> -- 
> 2.23.0
> 

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-April/016316.html

-- 
Best regards,
IM


More information about the Tarantool-patches mailing list