From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 607E74C885; Tue, 12 Jan 2021 18:26:37 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 607E74C885 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610465197; bh=ZKBxC6eT7FTgovAeX2jZBF1GC67zaABb0rhoqkcmKWw=; h=To:References:Date:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=GilHzvJ8/Ue/PPHOdwSmOPGNVveT2fvYqyUdUq3Ec85IEQqcHupuySishoJMfxQHO VmuyhQvFrqUt4vvElhcNferDQuBjqRux/qiBUCGjTjVA2Frt90Tj2N6QKGRRTybBIb DUkYx04IwKm7exRo/sY9fqYopFqIIu+LR9Avgkno= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 E820F4C885 for ; Tue, 12 Jan 2021 18:26:34 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E820F4C885 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1kzLZ4-0002fZ-2K; Tue, 12 Jan 2021 18:26:34 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org, lvasiliev@tarantool.org References: <08266e7e73c778c80dd9954b4e45fe1d5cfa9b21.1608647958.git.estetus@gmail.com> <63ceba2d-9aa3-84db-9d56-7d15a2053167@tarantool.org> Message-ID: <24c86655-d972-ff0c-feef-a42f2bb16dfb@tarantool.org> Date: Tue, 12 Jan 2021 18:26:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <63ceba2d-9aa3-84db-9d56-7d15a2053167@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CDAC53986DC5FB1AB1465E8C05863AF8B800894C459B0CD1B98B6A777847CDCFCA368C2AE2F0CB467C63A5AF46B80B1FB8985936BB30EC2273 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE72407438AC6002944EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637AD1E1BF10F09609D8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FCE681CCE15D286DCBFD3C673370DC59E8B84B4AAD49A6A1E6389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0F04B652EEC242312D2E47CDBA5A96583BD4B6F7A4D31EC0BC014FD901B82EE079FA2833FD35BB23D27C277FBC8AE2E8BAE9A1BBD95851C5BA471835C12D1D977C4224003CC836476EC64975D915A344093EC92FD9297F6718AA50765F7900637B7457ED07BBA7E3EA7F4EDE966BC389F395957E7521B51C24C7702A67D5C33162DBA43225CD8A89F9FFED5BD9FB4175542539A7722CA490CB5C8C57E37DE458B4C7702A67D5C3316FA3894348FB808DBCF17F1EDFBC1FB573B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A599F47E23128B9383CA32663B0DDFE64FCE4409AB2906F5E7D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34A08F09726D78E07BD1D39D0425A90585ADD168548317507FE528718F4DF0B25CB3EF613AD01EAE211D7E09C32AA3244CEB151180D085510678A2180FB76726E955E75C8D0ED9F6EE927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojKc4NKhtl7uE+2UPtAdZm1A== X-Mailru-Sender: 689FA8AB762F73937240DDB2502DDB70F566D6C4CFD49C196B8130BE6E37EC2ADD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH 1/3] luacheck: fix warnings in test/box X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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"} >> +}