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 C999C6EC5F; Tue, 2 Mar 2021 11:05:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C999C6EC5F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614672347; bh=t5MIVsRxV28p33XlFEN/1eLNL0EXVquIhOjqN33lWIM=; 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=p4L5A88d6PPAevE/nCc5UFDi7o4zG6iNCb7icZfWapt4QdwbPjUGlCg4pkNCyoyap Jt6wErd7jZDRVFkVwEE1zDts4h5sQyYpq8fkG9pTdPAjdIDjEoy82ZJHonxaaOOHWT 5J9EsZk+aJBCJU0VP8IZ2I5/gkaFkSP1jhKwfoiw= Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 41EFF6EC5F for ; Tue, 2 Mar 2021 11:05:46 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 41EFF6EC5F Received: by smtpng1.m.smailru.net with esmtpa (envelope-from ) id 1lH02L-0004Dr-Di; Tue, 02 Mar 2021 11:05:45 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: <68a02630-efac-0e6c-d6ab-0af18d0192c1@tarantool.org> <33adda25-ba4d-b50c-575e-9dd30b38488a@tarantool.org> <49412fc2-da26-dc44-0d40-2f73cbe46cf3@tarantool.org> <238f4e50-2884-a068-74f7-05fc70fe4a89@tarantool.org> Message-ID: <2ee55886-4ca2-eb90-558a-3876bf384220@tarantool.org> Date: Tue, 2 Mar 2021 11:05:45 +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: <238f4e50-2884-a068-74f7-05fc70fe4a89@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-7564579A: B8F34718100C35BD X-77F55803: 4F1203BC0FB41BD92A98208ECBDD29F5A6709E93A77B8502A831FF4624BDF5D2182A05F53808504073961D8E4C95686E343DEDE752920E0D7EA2B0E444A3A30387E9E0E27295AF6F X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7DB84ED444C624799EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F79006376F978168E59B07A5EA1F7E6F0F101C67CDEEF6D7F21E0D1D174C73DBBBFC76642EC80735919255E1822CADE9B8EA295088779AE8BA4B8380389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C07E7E81EEA8A9722B8941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B6042F1592492B88C6CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC374CE26A9E38610E75ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4930A3850AC1BE2E735D528F8CDFD49EC53C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: 0D63561A33F958A5356D8B2198E2919EF91022F4AD9E4D3B72368E8221215418D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D344E332383F80D58BB59D54582C967DDC2456BF2C1F9CB9B4730AC051202C39E884AAD36C184D11F4E1D7E09C32AA3244C753CBAFC766CE9FB8C21BFBFEB76E7AE39C99C45E8D137E9729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojnpKwxR6GFbum6LUOwKzx7w== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822D85E3DA8BB0AFD28C02DABA1EF0C8EF7DD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH v8 04/14] test: fix luacheck warnings W211 in test/sql-tap 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" Hi! On 02.03.2021 00:27, Vladislav Shpilevoy wrote: >> --- a/test/sql-tap/select9.test.lua >> +++ b/test/sql-tap/select9.test.lua >> @@ -274,8 +274,6 @@ test:do_execsql_test( >>          -- >>      }) >> >> -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >> -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >>  --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=]) >>  --local function reverse(lhs, rhs) >>  --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) >> >>>       }) >>>   -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >>> -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >>>   --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=]) >>> ==================== >>> >>> However even if we would would to keep them you wouldn't need `local _ = `. >>> You can call functions without saving their result into a variable. >> luacheck reports an error when result of function is not assigned to variable. >> >> With patch: >> >> --- a/test/sql-tap/select9.test.lua >> +++ b/test/sql-tap/select9.test.lua >> @@ -274,8 +274,7 @@ test:do_execsql_test( >>          -- >>      }) >> >> -local _ = test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >> -local _ = test:execsql([[SELECT * from "_space" where "name"='T2']])["id"] >> +test:execsql([[SELECT * from "_space" where "name"='T1']])["id"] >>  --X(276, "X!cmd", [=[["db","eval","SELECT * from _space where name='t2'","data","\n  set t2_space_id $data(id)\n"]]=]) >>  --local function reverse(lhs, rhs) >>  --    return X(283, "X!cmd", [=[["string","compare",["rhs"],["lhs"]]]=]) >> >> it reports: >> >> Checking test/sql-tap/select9.test.lua            1 error >> >>     test/sql-tap/select9.test.lua:289:1: (E011) expected '=' near 'iOuterLoop' >> >> Total: 0 warnings / 1 error in 264 files >> >> >> iOuterLoop is a variable on a next uncommented line. Seems Lua requires that function's result must be assigned to variable. > That is hardly possible. We have Lua calls not saved into anything. > For instance, grep fiber.name(...) calls. > > I suspect it is because you left ["id"] thing after the call. Because > result of [] indeed makes no sense without being used. Looks so. $ cat sample.lua function aaa()     return {} end aaa() aaa()['id'] local b = 'dd' $ luacheck --codes sample.lua Checking sample.lua                               1 error     sample.lua:8:1: (E011) expected '=' near 'local' Total: 0 warnings / 1 error in 1 file