Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tarantool-patches@dev.tarantool.org, lvasiliev@tarantool.org
Subject: Re: [Tarantool-patches] [PATCH 1/3] luacheck: fix warnings in test/box
Date: Tue, 12 Jan 2021 18:26:33 +0300	[thread overview]
Message-ID: <24c86655-d972-ff0c-feef-a42f2bb16dfb@tarantool.org> (raw)
In-Reply-To: <63ceba2d-9aa3-84db-9d56-7d15a2053167@tarantool.org>

Thanks for review!

On 11.01.2021 20:52, Vladislav Shpilevoy wrote:
> Hi! Thanks for the patch!
>
> See 2 comments below.
>
>> diff --git a/.luacheckrc b/.luacheckrc
>> index 4b829f3dc..17cff8671 100644
>> --- a/.luacheckrc
>> +++ b/.luacheckrc
>> @@ -102,3 +108,53 @@ files["src/box/lua/console.lua"] = {
>>           "212",
>>       }
>>   }
>> +files["test/box/box.lua"] = {
>> +    globals = {
>> +        "cfg_filter",
>> +        "sorted",
>> +        "iproto_request",
>> +    }
>> +}
>> +files["test/box/lua/push.lua"] = {
>> +    globals = {"push_collection"}
>> +}
>> +files["test/box/lua/index_random_test.lua"] = {
>> +    globals = {"index_random_test"}
>> +}
>> +files["test/box/lua/utils.lua"] = {
>> +    globals = {
>> +        "arithmetic",
>> +        "check_space",
>> +        "create_iterator",
>> +        "iterate",
>> +        "setmap",
>> +        "sort",
>> +        "space_field_types",
>> +        "space_bsize",
>> +        "table_generate",
>> +        "table_shuffle",
>> +        "tuple_to_string",
> 1. All these functions are returned by the module. It means,
> they are supposed to be used like this:
>
> 	utils = require('utils.lua')
> 	utils.setmap()
> 	utils.space_bsize()
> 	-- etc
>
> This in turn means you need to make them all 'local' in utils.lua.
> I did it, and the tests pass. Also some of these functions are
> probably unused, but I didn't check.
>
> The same for identifier.lua below.

- removed some functions from interfaces and their implementations

- most lua libs converted to modules and removed suppressions removed 
from luacheckrc except

"dump" function. It is used in module itself and mark it as local is not 
enough to make luacheck happy.

I didn't post patch here because it is too huge. Let me know if you need 
new patch series, I'll resend it.

>> +    }
>> +}
>> +files["test/box/lua/bitset.lua"] = {
>> +    globals = {
>> +        "clear",
>> +        "create_space",
>> +        "delete",
>> +        "drop_space",
>> +        "dump",
>> +        "fill",
>> +        "test_insert_delete",
> 2. Almost the same here. With a difference that the functions
> are not returned now. But they are used in a single file, so their
> 'return' like in utils.lua does should be easy to do.
>
> The same for fifo.lua below.
converted to modules
>
>> +    }
>> +}
>> +files["test/box/lua/fifo.lua"] = {
>> +    globals = {
>> +        "fifomax",
>> +        "fifo_push",
>> +        "fifo_top",
>> +        "find_or_create_fifo",
>> +    }
>> +}
>> +files["test/box/lua/identifier.lua"] = {
>> +     globals = {"run_test"}
>> +}

  reply	other threads:[~2021-01-12 15:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-22 14:54 [Tarantool-patches] [PATCH v7 0/3] Fix luacheck warnings in test/box-tap, test/box and test/box-py sergeyb
2020-12-22 14:54 ` [Tarantool-patches] [PATCH 1/3] luacheck: fix warnings in test/box sergeyb
2021-01-11 17:52   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-12 15:26     ` Sergey Bronnikov via Tarantool-patches [this message]
2021-01-13  7:58       ` Sergey Bronnikov via Tarantool-patches
2021-01-13 16:38       ` Vladislav Shpilevoy via Tarantool-patches
2021-01-14  7:49         ` Sergey Bronnikov via Tarantool-patches
2020-12-22 14:54 ` [Tarantool-patches] [PATCH v7 2/3] luacheck: fix warnings in test/box-py sergeyb
2020-12-22 14:54 ` [Tarantool-patches] [PATCH v7 3/3] luacheck: fix warnings in test/box-tap sergeyb
2021-01-11 17:52   ` Vladislav Shpilevoy via Tarantool-patches
2021-01-12 13:59     ` Sergey Bronnikov via Tarantool-patches
2021-01-12 14:52       ` Vladislav Shpilevoy via Tarantool-patches
2021-01-12 15:21         ` Sergey Bronnikov via Tarantool-patches
2020-12-25 10:37 ` [Tarantool-patches] [PATCH v7 0/3] Fix luacheck warnings in test/box-tap, test/box and test/box-py Kirill Yukhin
2020-12-30 10:17   ` Kirill Yukhin
2020-12-30 12:27 ` Leonid Vasiliev
2021-01-14 21:34 ` Vladislav Shpilevoy via Tarantool-patches
2021-01-15  9:48 ` Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24c86655-d972-ff0c-feef-a42f2bb16dfb@tarantool.org \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=lvasiliev@tarantool.org \
    --cc=sergeyb@tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 1/3] luacheck: fix warnings in test/box' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox