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 12AE74C883; Mon, 11 Jan 2021 20:52:52 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 12AE74C883 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610387572; bh=nrpC0UsF0Qs3mmtpje0nJDyNvHPVAhgXVq/GOCvYihI=; 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=M2bDUdCQQs0hGJHmaC9t937ybZ+bMK4WLDQ/puhNN1BxLtlGOaeBkGzdhl0cmW3Mg fRfaaudxemI7216CjeLOuKpbUbxf3nO5fCMLCxyAyJCoYQrBfmlmwmtzQrYoudz+Tu hfyt0U+7/CAm+3sRahTbLIq3IKCiA4IisnizY9HQ= 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 1B67784390 for ; Mon, 11 Jan 2021 20:52:51 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 1B67784390 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1kz1N3-0007zv-V0; Mon, 11 Jan 2021 20:52:50 +0300 To: sergeyb@tarantool.org, tarantool-patches@dev.tarantool.org, lvasiliev@tarantool.org References: <08266e7e73c778c80dd9954b4e45fe1d5cfa9b21.1608647958.git.estetus@gmail.com> Message-ID: <63ceba2d-9aa3-84db-9d56-7d15a2053167@tarantool.org> Date: Mon, 11 Jan 2021 18:52:48 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <08266e7e73c778c80dd9954b4e45fe1d5cfa9b21.1608647958.git.estetus@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-7564579A: 78E4E2B564C1792B X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CDC332107C56D78A30EABAEB9DEE13ADFC00894C459B0CD1B92484291992D3E31FBC3AE1B9F97C153FC1ABA22156B6F8F6CF2D425F2FC6F947 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE76AB1B6FB25ACEDC9EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006377A06FA5CCF78F9BC8638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC9FBEA1394F81B8B7E8539BDE0D5FE140555E397FCD9547F9389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C03103C3FD12A8101D8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6D6FBC3EC642A93BBCC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC8A0925CD2C14BB9D75ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4931B544F03EFBC4D57E5B2F3A2B87CD4C8C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0FECB2555BB02FD5A93B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A52FCB847A2C60F40BFB012A596A84F4592B11D13AF4F60546D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA758F9E841AEAEC4F2C410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3453741B480A6503C365B14F6787B031A1307D9E2E76DC1DC1316DF90AC6CF74E0558373B337E2A42D1D7E09C32AA3244CF03AD8C8C4CC798CEA575FBFB62D80C4B038C9161EF167A1927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojmz2Dv49v36id3KVacZbNtA== X-Mailru-Sender: 689FA8AB762F73937240DDB2502DDB706886FDA8D9971F6E8AD3E7B669B8EA153841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B 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: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" 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. > + } > +} > +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. > + } > +} > +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"} > +}