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 DF74F7030F; Thu, 25 Feb 2021 14:02:12 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org DF74F7030F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1614250932; bh=puLZFRJoLqc3HrCmyGZ0C2eFpjxBr7culA5yY4+EN1A=; 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=cxA34WRGC5RCcpNFC6muviZ0mzI0cwlYhCuBPHgW/x2NQYZvwsxJhbeS9f0TQxJVq kgh+nZV2RWq8T8fcsiNNklF1Z/ANGHv2M7FX3C5+258kG/akXwx5sOemWaIzm9SrND 04sfIbNBfbjXWW3zQ0C1L5t6LNLJOjelUFFduPhg= Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 EF1D37030F for ; Thu, 25 Feb 2021 14:02:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org EF1D37030F Received: by smtpng2.m.smailru.net with esmtpa (envelope-from ) id 1lFEPL-0003NK-8q; Thu, 25 Feb 2021 14:02:11 +0300 To: Vladislav Shpilevoy , tarantool-patches@dev.tarantool.org References: <68a02630-efac-0e6c-d6ab-0af18d0192c1@tarantool.org> Message-ID: Date: Thu, 25 Feb 2021 14:02:11 +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: <68a02630-efac-0e6c-d6ab-0af18d0192c1@tarantool.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD975C3EC174F566922928A658C60196E87DF7449A63D990329182A05F538085040443CABD2E9B87D3C6970B8A5EA20EACE1733572B21620B19BB360CAC571740DA X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE73C714006C69EB7BAEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637B3D52627AD81B52CEA1F7E6F0F101C674E70A05D1297E1BBC6CDE5D1141D2B1CCA3F57480A9227E94B6B074A326C9AC7B7CF4B99CF8EE2ED9FA2833FD35BB23D9E625A9149C048EE1E561CDFBCA1751FF6B57BC7E64490618DEB871D839B7333395957E7521B51C2DFABB839C843B9C08941B15DA834481F8AA50765F7900637D9CFB327BC390E24389733CBF5DBD5E9B5C8C57E37DE458BD96E472CDF7238E04AD6D5ED66289B5278DA827A17800CE75B51C8FB0C3E748C67F23339F89546C5A8DF7F3B2552694A6FED454B719173D6725E5C173C3A84C3F8A0C55DE5E8D0B235872C767BF85DA2F004C906525384306FED454B719173D6462275124DF8B9C9DE2850DD75B2526BE5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A5A5144F03D7CA8B4438A850D0DA8C81D7620CA03BAD744AC7D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA7557E988E9157162368E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3454E98140CCACB5B321C0D2F966CA0C88112D1C8662E707AE5E225A712C9DE683947B466E9C8AAF911D7E09C32AA3244C9C021F61049B8D1E849DDA6C02C9D01B435BF7150578642F729B2BEF169E0186 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojvz1c9SWJtj9wfay84eMEpQ== X-Mailru-Sender: 689FA8AB762F73936BC43F508A0638225CE61E68C0FE1BE57251BD0695E977FBDD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B 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" Hello, On 24.02.2021 00:26, Vladislav Shpilevoy wrote: > Thanks for the patch! > > See 5 comments below. > >> diff --git a/test/sql-tap/e_expr.test.lua b/test/sql-tap/e_expr.test.lua >> index 37a7b7177..046ed8711 100755 >> --- a/test/sql-tap/e_expr.test.lua >> +++ b/test/sql-tap/e_expr.test.lua >> @@ -1087,7 +1087,7 @@ if (0>0) then >> local number = nil >> local stmt = sql_prepare_v2(sql, -1) >> for _ in X(0, "X!foreach", [=[["number name",["params"]]]=]) do >> - local nm = sql_bind_parameter_name(stmt, number) >> + local nm = sql_bind_parameter_name(stmt, number) -- luacheck: no unused > 1. Why do you need 'nm' if it is unused? You don't need to drop the > entire line. Just delete 'nm' variable and leave the function call > without saving its result to anything. The same below for 'rc' and > 'sql_finalize()'. reverted changes back --- a/test/sql-tap/e_expr.test.lua +++ b/test/sql-tap/e_expr.test.lua @@ -1087,7 +1087,7 @@ if (0>0) then          local number = nil          local stmt = sql_prepare_v2(sql, -1)          for _ in X(0, "X!foreach", [=[["number name",["params"]]]=]) do -            local nm = sql_bind_parameter_name(stmt, number) -- luacheck: no unused +            sql_bind_parameter_name(stmt, number)              X(480, "X!cmd", [=[["do_test",[["tn"],".name.",["number"]],[["list","set","",["nm"]]],["name"]]]=])              sql_bind_int(stmt, number, ((-1) * number))          end @@ -1103,7 +1103,7 @@ if (0>0) then          -- Legacy from the original code. Must be replaced with analogue          -- functions from box.          local sql_finalize = nil -        local rc = sql_finalize(stmt) -- luacheck: no unused +        sql_finalize(stmt)          X(491, "X!cmd", [=[["do_test",[["tn"],".rc"],[["list","set","",["rc"]]],"sql_OK"]]=])          X(492, "X!cmd", [=[["do_test",[["tn"],".res"],[["list","set","",["res"]]],["result"]]]=])      end > >> X(480, "X!cmd", [=[["do_test",[["tn"],".name.",["number"]],[["list","set","",["nm"]]],["name"]]]=]) >> sql_bind_int(stmt, number, ((-1) * number)) >> end >> diff --git a/test/sql-tap/func.test.lua b/test/sql-tap/func.test.lua >> index 9cd517673..5dab23007 100755 >> --- a/test/sql-tap/func.test.lua >> +++ b/test/sql-tap/func.test.lua >> @@ -1382,7 +1380,6 @@ test:do_execsql_test( >> }) >> >> db("cache", "flush") >> -V = "three" > 2. 'V' is supposed to be a variable. It is used in the queries > in the surrounding code. Please, don't delete parts of the tests. > It will not make it simpler to restore the context later. The tests > in this patchset either must be deleted, or resurrected, or hacked > to keep their context and not fail luacheck. What to choose - depends > on individual tests. Here clearly we need to keep 'V'. Try to make > another pass of self-review to locate more of such test-"breaking" > changes. reverted and suppressed --- a/test/sql-tap/func.test.lua +++ b/test/sql-tap/func.test.lua @@ -1382,6 +1382,7 @@ test:do_execsql_test(      })  db("cache", "flush") +local V = "three" -- luacheck: no unused  test:do_execsql_test(      "13.8.6",      [[ >> diff --git a/test/sql-tap/selectA.test.lua b/test/sql-tap/selectA.test.lua >> index a608ab093..db4d03985 100755 >> --- a/test/sql-tap/selectA.test.lua >> +++ b/test/sql-tap/selectA.test.lua >> @@ -2359,9 +2357,6 @@ test:do_execsql_test( >> if (0 > 0) >> then >> end >> -local function f(args) >> - return 1 >> -end > 3. It seems the function is supposed to be somehow used a few > lines below. Please, keep it. > reverted and suppressed --- a/test/sql-tap/selectA.test.lua +++ b/test/sql-tap/selectA.test.lua @@ -2357,6 +2357,9 @@ test:do_execsql_test(  if (0 > 0)   then  end +local function f(args) -- luacheck: no unused +    return 1 +end  -- TODO stored procedures are not supported by now  --db("func", "f", "f") >> -- TODO stored procedures are not supported by now >> --db("func", "f", "f")> diff --git a/test/sql-tap/sort.test.lua b/test/sql-tap/sort.test.lua >> index 1cf0d14a8..0de598969 100755 >> --- a/test/sql-tap/sort.test.lua >> +++ b/test/sql-tap/sort.test.lua >> @@ -802,7 +801,6 @@ box.internal.sql_create_function("cksum", cksum) >> "sort-14."..tn, >> function() >> sql_test_control("sql_TESTCTRL_SORTER_MMAP", "db", mmap_limit) >> - local prev = "" > 4. Prev is supposed to be used in the request on the next line. It > has `$prev` expression inside. reverted and suppressed --- a/test/sql-tap/sort.test.lua +++ b/test/sql-tap/sort.test.lua @@ -801,6 +801,7 @@ box.internal.sql_create_function("cksum", cksum)              "sort-14."..tn,              function()                  sql_test_control("sql_TESTCTRL_SORTER_MMAP", "db", mmap_limit) +                local prev = "" -- luacheck: no unused                  X(536, "X!cmd", [=[["db","eval"," SELECT * FROM t11 ORDER BY b ","\n         if {$b != [cksum $a]} {error \"checksum failed\"}\n         if {[string compare $b $prev] < 0} {error \"sort failed\"}\n         set prev $b\n       "]]=])                  return X(541, "X!cmd", [=[["set","",""]]=])              end, { > >> X(536, "X!cmd", [=[["db","eval"," SELECT * FROM t11 ORDER BY b ","\n if {$b != [cksum $a]} {error \"checksum failed\"}\n if {[string compare $b $prev] < 0} {error \"sort failed\"}\n set prev $b\n "]]=]) >> return X(541, "X!cmd", [=[["set","",""]]=]) >> end, { >> diff --git a/test/sql-tap/trigger1.test.lua b/test/sql-tap/trigger1.test.lua >> index 8224ef1ec..0efdd21bc 100755 >> --- a/test/sql-tap/trigger1.test.lua >> +++ b/test/sql-tap/trigger1.test.lua >> @@ -482,8 +482,6 @@ test:execsql [[ >> -- trigger works. Then drop the trigger. Make sure the table is >> -- still there. >> -- >> -local view_v1 = "view v1" > 5. The variable is "used" in some of the commented out tests below. reverted and suppressed --- a/test/sql-tap/trigger1.test.lua +++ b/test/sql-tap/trigger1.test.lua @@ -483,6 +483,7 @@ test:execsql [[  -- still there.  -- +local view_v1 = "view v1" -- luacheck: no unused  -- do_test trigger1-6.1 {  --   execsql {SELECT type, name FROM sql_master}  -- } [concat $view_v1 {table t2}] > >> - >> >> -- do_test trigger1-6.1 { >> -- execsql {SELECT type, name FROM sql_master}