From: Sergey Bronnikov via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Subject: [Tarantool-patches] [PATCH v8 06/14] test: fix laucheck warnings W213 in test/sql-tap Date: Thu, 21 Jan 2021 15:50:03 +0300 [thread overview] Message-ID: <316462e217117629e781d7aff533741763005b2c.1611232655.git.sergeyb@tarantool.org> (raw) In-Reply-To: <cover.1611232655.git.sergeyb@tarantool.org> From: Sergey Bronnikov <sergeyb@tarantool.org> W213 (Unused loop variable) Part of #5464 --- .luacheckrc | 2 -- test/sql-tap/analyze9.test.lua | 2 +- test/sql-tap/between.test.lua | 2 +- test/sql-tap/e_expr.test.lua | 6 +++--- test/sql-tap/gh-2723-concurrency.test.lua | 8 ++++---- test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua | 2 +- test/sql-tap/gh-3332-tuple-format-leak.test.lua | 2 +- test/sql-tap/gh2127-indentifier-max-length.test.lua | 10 +++++----- test/sql-tap/lua/sqltester.lua | 2 +- test/sql-tap/misc5.test.lua | 2 +- test/sql-tap/select1.test.lua | 2 +- test/sql-tap/selectB.test.lua | 4 ++-- test/sql-tap/trigger2.test.lua | 4 ++-- 13 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index c986b1cc2..2e33cc05e 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -51,8 +51,6 @@ exclude_files = { files["test/sql-tap/**/*.lua"] = { ignore = { - -- Unused loop variable. - "213", -- Local variable is set but never accessed. "231", -- "Value assigned to a local variable is unused." diff --git a/test/sql-tap/analyze9.test.lua b/test/sql-tap/analyze9.test.lua index 775b02587..794bda379 100755 --- a/test/sql-tap/analyze9.test.lua +++ b/test/sql-tap/analyze9.test.lua @@ -242,7 +242,7 @@ test:do_execsql_test( local function insert_filler_rows_n(iStart, nCopy, nVal) for i = 0, nVal-1 do local iVal = iStart+i - for j = 0, nCopy-1 do + for _ = 0, nCopy-1 do box.execute(string.format("INSERT INTO t1 VALUES (null, %s, %s, '%s')", iVal, iVal, iVal)) end end diff --git a/test/sql-tap/between.test.lua b/test/sql-tap/between.test.lua index 550976b86..755833736 100755 --- a/test/sql-tap/between.test.lua +++ b/test/sql-tap/between.test.lua @@ -61,7 +61,7 @@ local function queryplan(sql) table.insert(data,x) local eqp = box.execute("EXPLAIN QUERY PLAN "..sql.."").rows -- puts eqp=$eqp - for i, val in ipairs(eqp) do + for _, val in ipairs(eqp) do --local a = val[1] --local b = val[2] --local c = val[3] diff --git a/test/sql-tap/e_expr.test.lua b/test/sql-tap/e_expr.test.lua index 9947bbcd4..5f8b206d3 100755 --- a/test/sql-tap/e_expr.test.lua +++ b/test/sql-tap/e_expr.test.lua @@ -2120,7 +2120,7 @@ test:do_execsql_test( local likeargs = {} local function likefunc(...) local args = {...} - for i, v in ipairs(args) do + for _, v in ipairs(args) do table.insert(likeargs, v) end return 1 @@ -2353,7 +2353,7 @@ end local regexpargs = {} local function regexpfunc(...) local args = {...} - for i, v in ipairs(args) do + for _, v in ipairs(args) do table.insert(regexpargs, v) end return 1 @@ -2412,7 +2412,7 @@ test:do_test( local matchargs = { } local function matchfunc(...) local args = {...} - for i, v in ipairs(args) do + for _, v in ipairs(args) do table.insert(matchargs, v) end return 1 diff --git a/test/sql-tap/gh-2723-concurrency.test.lua b/test/sql-tap/gh-2723-concurrency.test.lua index aa9be0130..d48760ac4 100755 --- a/test/sql-tap/gh-2723-concurrency.test.lua +++ b/test/sql-tap/gh-2723-concurrency.test.lua @@ -20,7 +20,7 @@ for id = 1, N do end ) end -for id = 1, N do +for _ = 1, N do ch:get() end @@ -46,7 +46,7 @@ for id = 1, N do end ) end -for id = 1, N do +for _ = 1, N do ch:get() end test:do_test( @@ -64,7 +64,7 @@ box.execute("create index i1 on t1(b);") for id = 1, N*N do box.execute(string.format("insert into t1 values(%s, %s, 3)", id, id)) end -for id = 1, N do +for _ = 1, N do fiber.create( function () box.execute("delete from t1") @@ -72,7 +72,7 @@ for id = 1, N do end ) end -for id = 1, N do +for _ = 1, N do ch:get() end test:do_test( diff --git a/test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua b/test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua index 0b7c3ca32..57302811b 100755 --- a/test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua +++ b/test/sql-tap/gh-3083-ephemeral-unref-tuples.test.lua @@ -12,7 +12,7 @@ test:do_test( box.execute("insert into test(id, k) values(" .. i .. "," .. i .. ")") end - for i = 1, 10000 do + for i = 1, 10000 do -- luacheck: ignore unused i box.execute("SELECT id, k FROM test WHERE k IN (5849, 4986, 4997, 5020, 5044, 4990, 5013, 4983)") end end, { diff --git a/test/sql-tap/gh-3332-tuple-format-leak.test.lua b/test/sql-tap/gh-3332-tuple-format-leak.test.lua index 5e286ed0d..48c6268cf 100755 --- a/test/sql-tap/gh-3332-tuple-format-leak.test.lua +++ b/test/sql-tap/gh-3332-tuple-format-leak.test.lua @@ -21,7 +21,7 @@ test:do_test( test:do_test( "format-leak", function() - for i = 1, 100000 do + for i = 1, 100000 do -- luacheck: ignore unused i box.execute("SELECT id FROM t1 WHERE flags=3 ORDER BY id LIMIT 2"); end end, { diff --git a/test/sql-tap/gh2127-indentifier-max-length.test.lua b/test/sql-tap/gh2127-indentifier-max-length.test.lua index 112689327..bab70b714 100755 --- a/test/sql-tap/gh2127-indentifier-max-length.test.lua +++ b/test/sql-tap/gh2127-indentifier-max-length.test.lua @@ -7,7 +7,7 @@ local tt = {} local table_word = "АААААААААА" -- Create 30kb table name -for i=1,300 do +for i=1,300 do -- luacheck: ignore unused i table.insert(tt, table_word) end @@ -27,7 +27,7 @@ local vt = {} local view_word = "BBBBBBBBBB" -- Create 30kb view name -for i=1, 300 do +for i=1, 300 do -- luacheck: ignore unused i table.insert(vt, view_word) end @@ -45,7 +45,7 @@ local it = {} local index_word = "ЕЕЕЕЕЕЕЕЕЕ" -- Create 30kb index name -for i=1, 300 do +for i=1, 300 do -- luacheck: ignore unused i table.insert(it, index_word) end @@ -55,7 +55,7 @@ local field_table = {} local field_word = 'ДДДДДДДДД' -- Create 30kb field name -for i=1, 300 do +for i=1, 300 do -- luacheck: ignore unused i table.insert(field_table, field_word) end @@ -75,7 +75,7 @@ test:do_execsql_test( local trig_table = {} local trigger_word = "ССССССССС" -for i=1, 300 do +for i=1, 300 do -- luacheck: ignore unused i table.insert(trig_table, trigger_word) end diff --git a/test/sql-tap/lua/sqltester.lua b/test/sql-tap/lua/sqltester.lua index af1c2476e..fbecb47ea 100644 --- a/test/sql-tap/lua/sqltester.lua +++ b/test/sql-tap/lua/sqltester.lua @@ -272,7 +272,7 @@ test.catchsql2 = catchsql2 -- that different SQL statements generate exactly the same VDBE code. local function explain_no_trace(self, sql) local tr = execsql(self, "EXPLAIN "..sql) - for i=1,8 do + for i=1,8 do -- luacheck: ignore unused i table.remove(tr,1) end return tr diff --git a/test/sql-tap/misc5.test.lua b/test/sql-tap/misc5.test.lua index 4bc18aa87..62678bbbd 100755 --- a/test/sql-tap/misc5.test.lua +++ b/test/sql-tap/misc5.test.lua @@ -292,7 +292,7 @@ test:do_test( local sql, tail sql = "INSERT INTO t1 VALUES(" tail = "" - for i = 0, 199, 1 do + for i = 0, 199, 1 do -- luacheck: ignore unused i sql = sql .. "(1+" tail = tail .. ")" end diff --git a/test/sql-tap/select1.test.lua b/test/sql-tap/select1.test.lua index 99bcce93b..d1301e5ad 100755 --- a/test/sql-tap/select1.test.lua +++ b/test/sql-tap/select1.test.lua @@ -1974,7 +1974,7 @@ test:do_test( START TRANSACTION; INSERT INTO abc VALUES(1, 1, 1); ]] - for i = 0,9,1 do + for i = 0,9,1 do -- luacheck: ignore unused i test:execsql [[ INSERT INTO abc SELECT a+(select max(a) FROM abc), b+(select max(a) FROM abc), c+(select max(a) FROM abc) FROM abc; ]] diff --git a/test/sql-tap/selectB.test.lua b/test/sql-tap/selectB.test.lua index b56403ce5..6c7bc805a 100755 --- a/test/sql-tap/selectB.test.lua +++ b/test/sql-tap/selectB.test.lua @@ -26,11 +26,11 @@ local function test_transform(testname, sql1, sql2, results) local vdbe1 = { } local vdbe2 = { } local data = box.execute("explain "..sql1) - for i, line in ipairs(data) do + for _, line in ipairs(data) do table.insert(vdbe1, line[2]) end data = box.execute("explain "..sql2) - for i, line in ipairs(data) do + for _, line in ipairs(data) do table.insert(vdbe2, line[2]) end test:do_test( diff --git a/test/sql-tap/trigger2.test.lua b/test/sql-tap/trigger2.test.lua index 680cd07b8..4a4454597 100755 --- a/test/sql-tap/trigger2.test.lua +++ b/test/sql-tap/trigger2.test.lua @@ -127,12 +127,12 @@ for _, tbl_defn in ipairs(tbl_definitions) do local raw_result = test:execsql [[ SELECT * FROM rlog ORDER BY idx; ]] - for k,v in pairs(raw_result) do table.insert(r, v) end + for _,v in pairs(raw_result) do table.insert(r, v) end raw_result = test:execsql [[ SELECT * FROM clog ORDER BY idx; ]] - for k,v in pairs(raw_result) do table.insert(r, v) end + for _,v in pairs(raw_result) do table.insert(r, v) end return r end, { -- 2.25.1
next prev parent reply other threads:[~2021-01-21 12:53 UTC|newest] Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-01-21 12:49 [Tarantool-patches] [PATCH v8 00/14] Fix luacheck warnings in test/sql and test/sql-tap Sergey Bronnikov via Tarantool-patches 2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 01/14] test: fix luacheck warnings in test/sql Sergey Bronnikov via Tarantool-patches 2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 02/14] test: remove functions to open and close SQL connection Sergey Bronnikov via Tarantool-patches 2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 03/14] test: fix luacheck warnings W113 in test/sql-tap Sergey Bronnikov via Tarantool-patches 2021-01-24 17:33 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-06 17:52 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-16 12:02 ` Sergey Bronnikov via Tarantool-patches 2021-02-23 21:25 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-25 10:39 ` Sergey Bronnikov via Tarantool-patches 2021-02-26 23:42 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-27 17:53 ` Sergey Bronnikov via Tarantool-patches 2021-02-28 15:30 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-01 13:26 ` Sergey Bronnikov via Tarantool-patches 2021-01-21 12:49 ` [Tarantool-patches] [PATCH v8 04/14] test: fix luacheck warnings W211 " Sergey Bronnikov via Tarantool-patches 2021-01-24 17:34 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-16 14:09 ` Sergey Bronnikov via Tarantool-patches 2021-02-23 21:26 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-25 11:02 ` Sergey Bronnikov via Tarantool-patches 2021-02-26 23:42 ` Vladislav Shpilevoy via Tarantool-patches 2021-02-27 17:09 ` Sergey Bronnikov via Tarantool-patches 2021-02-28 15:30 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-01 13:46 ` Sergey Bronnikov via Tarantool-patches 2021-03-01 21:27 ` Vladislav Shpilevoy via Tarantool-patches 2021-03-02 8:05 ` Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 05/14] test: fix luacheck warnings W212 " Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` Sergey Bronnikov via Tarantool-patches [this message] 2021-01-24 17:35 ` [Tarantool-patches] [PATCH v8 06/14] test: fix laucheck warnings W213 " Vladislav Shpilevoy via Tarantool-patches 2021-01-29 16:32 ` Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 07/14] test: fix luacheck warnings W231 " Sergey Bronnikov via Tarantool-patches 2021-01-24 17:35 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-29 22:39 ` Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 08/14] test: fix luacheck warnings W311 " Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 09/14] test: fix luacheck warnings W511 " Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 10/14] test: fix luacheck warnings W512 " Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 11/14] test: fix luacheck warnings W542 " Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 12/14] test: fix luacheck warnings W612, W613, W614 " Sergey Bronnikov via Tarantool-patches 2021-01-24 17:36 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-29 16:23 ` Sergey Bronnikov via Tarantool-patches 2021-01-29 21:50 ` Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 13/14] test: fix luacheck warnings W621 " Sergey Bronnikov via Tarantool-patches 2021-01-24 17:37 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-29 16:11 ` Sergey Bronnikov via Tarantool-patches 2021-01-21 12:50 ` [Tarantool-patches] [PATCH v8 14/14] luacheck: add issues for suppressed warnings Sergey Bronnikov via Tarantool-patches 2021-01-24 17:37 ` Vladislav Shpilevoy via Tarantool-patches 2021-01-29 16:13 ` Sergey Bronnikov via Tarantool-patches 2021-03-01 21:37 ` [Tarantool-patches] [PATCH v8 00/14] Fix luacheck warnings in test/sql and test/sql-tap Vladislav Shpilevoy via Tarantool-patches 2021-03-02 9:47 ` 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=316462e217117629e781d7aff533741763005b2c.1611232655.git.sergeyb@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=sergeyb@tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v8 06/14] test: fix laucheck warnings W213 in test/sql-tap' \ /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