[Tarantool-patches] [PATCH 1/2] luacheck: fix warnings in test/box

Serge Petrenko sergepetrenko at tarantool.org
Fri Jan 15 15:39:45 MSK 2021



15.01.2021 14:22, sergeyb at tarantool.org пишет:
> From: Sergey Bronnikov <sergeyb at tarantool.org>
>
> Follows up #5455
> ---

Thanks for the  patch!
LGTM.
One question below.


>   test/box/gh-5304-insert_during_recovery.lua  | 10 +++++-----
>   test/box/gh-5304-replace_during_recovery.lua |  1 +
>   2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/test/box/gh-5304-insert_during_recovery.lua b/test/box/gh-5304-insert_during_recovery.lua
> index ac6eef342..c8b6c5cfb 100644
> --- a/test/box/gh-5304-insert_during_recovery.lua
> +++ b/test/box/gh-5304-insert_during_recovery.lua
> @@ -1,24 +1,24 @@
>   #!/usr/bin/env tarantool
>   
> -function none(old_space, new_space)
> +local function none(old_space, new_space) -- luacheck: ignore

What's "luacheck: ignore" comment for? Haven't you fixed the warning 
already by introducing `local` ?

>   end
>   
> -function trigger_replace(old_space, new_space)
> +local function trigger_replace(old_space, new_space) -- luacheck: ignore
>       box.space.temp:replace({1})
>       box.space.loc:replace({1})
>   end
>   
> -function trigger_insert(old_space, new_space)
> +local function trigger_insert(old_space, new_space) -- luacheck: ignore
>       box.space.temp:insert({1})
>       box.space.loc:insert({1})
>   end
>   
> -function trigger_upsert(old_space, new_space)
> +local function trigger_upsert(old_space, new_space) -- luacheck: ignore
>       box.space.temp:upsert({1}, {{'=', 1, 4}})
>       box.space.loc:upsert({1}, {{'=', 1, 4}})
>   end
>   
> -trigger = nil
> +local trigger = nil
>   
>   if arg[1] == 'none' then
>       trigger = none
> diff --git a/test/box/gh-5304-replace_during_recovery.lua b/test/box/gh-5304-replace_during_recovery.lua
> index d6a7099ac..8b9a657af 100644
> --- a/test/box/gh-5304-replace_during_recovery.lua
> +++ b/test/box/gh-5304-replace_during_recovery.lua
> @@ -2,6 +2,7 @@
>   
>   if arg[1] == 'replace' then
>       box.ctl.on_schema_init(function()
> +        -- luacheck: ignore
>           box.space._index:on_replace(function(old_space, new_space)
>               if new_space[1] == 512 then
>                   box.space.test:on_replace(function(old_tup, new_tup)

-- 
Serge Petrenko



More information about the Tarantool-patches mailing list