Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergeyb@tarantool.org
To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org,
	imun@tarantool.org
Cc: o.piskunov@tarantool.org, alexander.turenko@tarantool.org
Subject: [Tarantool-patches] [PATCH v6 17/25] Fix luacheck warnings in test/sql
Date: Fri, 29 May 2020 18:09:26 +0300	[thread overview]
Message-ID: <91d3067bdea24ca0d8470d3b474f3c9d8d23679c.1590764168.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1590764167.git.sergeyb@tarantool.org>

From: Sergey Bronnikov <sergeyb@tarantool.org>

Part of #4681

Reviewed-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
Reviewed-by: Igor Munkin <imun@tarantool.org>
---
 .luacheckrc                    | 2 +-
 test/sql/lua/sql_tokenizer.lua | 2 +-
 test/sql/savepoints.result     | 6 +++---
 test/sql/savepoints.test.lua   | 6 +++---
 test/sql/triggers.result       | 2 +-
 test/sql/triggers.test.lua     | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/.luacheckrc b/.luacheckrc
index f607732a9..97efdd8c7 100644
--- a/.luacheckrc
+++ b/.luacheckrc
@@ -12,7 +12,7 @@ exclude_files = {
     "test/engine_long/*.lua",
     "test/long_run-py/**/*.lua",
     "test/replication/*.test.lua",
-    "test/sql/*.lua",
+    "test/sql/*.test.lua",
     "test/swim/*.lua",
     "test/var/**/*.lua",
     "test/vinyl/*.lua",
diff --git a/test/sql/lua/sql_tokenizer.lua b/test/sql/lua/sql_tokenizer.lua
index 9922d792d..ffe4fb4e8 100644
--- a/test/sql/lua/sql_tokenizer.lua
+++ b/test/sql/lua/sql_tokenizer.lua
@@ -134,7 +134,7 @@ end
 -- @retval Token type. If the rest of the SQL request consists of
 --         spaces and comments, then return TK_EMPTY.
 local function get_next_token(context)
-    local c = ''
+    local c
     repeat
         local i = context.offset
         c = context.sql:sub(i, i)
diff --git a/test/sql/savepoints.result b/test/sql/savepoints.result
index 509c33e59..b0915f398 100644
--- a/test/sql/savepoints.result
+++ b/test/sql/savepoints.result
@@ -102,12 +102,12 @@ collision_sv_2 = function()
     box.begin()
     box.execute('SAVEPOINT t1;')
     box.execute('SAVEPOINT t2;')
-    local _,err = box.execute('SAVEPOINT t1;')
+    local _, err = box.execute('SAVEPOINT t1;')
     assert(err == nil)
     box.execute('RELEASE SAVEPOINT t1;')
-    local _,err = box.execute('RELEASE SAVEPOINT t1;')
+    _, err = box.execute('RELEASE SAVEPOINT t1;')
     assert(err ~= nil)
-    local _, err = box.execute('ROLLBACK TO t2;')
+    _, err = box.execute('ROLLBACK TO t2;')
     assert(err == nil)
 end;
 ---
diff --git a/test/sql/savepoints.test.lua b/test/sql/savepoints.test.lua
index f1b15c748..eb7bea37d 100644
--- a/test/sql/savepoints.test.lua
+++ b/test/sql/savepoints.test.lua
@@ -65,12 +65,12 @@ collision_sv_2 = function()
     box.begin()
     box.execute('SAVEPOINT t1;')
     box.execute('SAVEPOINT t2;')
-    local _,err = box.execute('SAVEPOINT t1;')
+    local _, err = box.execute('SAVEPOINT t1;')
     assert(err == nil)
     box.execute('RELEASE SAVEPOINT t1;')
-    local _,err = box.execute('RELEASE SAVEPOINT t1;')
+    _, err = box.execute('RELEASE SAVEPOINT t1;')
     assert(err ~= nil)
-    local _, err = box.execute('ROLLBACK TO t2;')
+    _, err = box.execute('ROLLBACK TO t2;')
     assert(err == nil)
 end;
 collision_sv_2();
diff --git a/test/sql/triggers.result b/test/sql/triggers.result
index ceecb8ef2..e70d72947 100644
--- a/test/sql/triggers.result
+++ b/test/sql/triggers.result
@@ -11,7 +11,7 @@ _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 ---
 ...
 -- Get invariant part of the tuple; name and opts don't change.
- function immutable_part(data) local r = {} for i, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end
+ function immutable_part(data) local r = {} for _, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end
 ---
 ...
 --
diff --git a/test/sql/triggers.test.lua b/test/sql/triggers.test.lua
index f5c8a3961..bc694ebc4 100644
--- a/test/sql/triggers.test.lua
+++ b/test/sql/triggers.test.lua
@@ -4,7 +4,7 @@ engine = test_run:get_cfg('engine')
 _ = box.space._session_settings:update('sql_default_engine', {{'=', 2, engine}})
 
 -- Get invariant part of the tuple; name and opts don't change.
- function immutable_part(data) local r = {} for i, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end
+ function immutable_part(data) local r = {} for _, l in pairs(data) do table.insert(r, {l.name, l.opts}) end return r end
 
 --
 -- gh-3273: Move Triggers to server
-- 
2.23.0

  parent reply	other threads:[~2020-05-29 15:15 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 15:08 [Tarantool-patches] [PATCH v6 00/25] Add static analysis with luacheck sergeyb
2020-05-29 15:08 ` [Tarantool-patches] [PATCH v6 01/25] Add initial luacheck config sergeyb
2020-05-29 16:04   ` Igor Munkin
2020-05-29 16:27     ` Igor Munkin
2020-05-30 12:19       ` Sergey Bronnikov
2020-05-30 12:18     ` Sergey Bronnikov
2020-05-29 15:08 ` [Tarantool-patches] [PATCH v6 02/25] build: enable 'make luacheck' target sergeyb
2020-05-29 16:28   ` Igor Munkin
2020-05-29 15:08 ` [Tarantool-patches] [PATCH v6 03/25] gitlab-ci: enable static analysis with luacheck sergeyb
2020-05-29 19:25   ` Igor Munkin
2020-06-01  9:29     ` Sergey Bronnikov
2020-06-01  9:48       ` Igor Munkin
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 04/25] Fix luacheck warnings in extra/dist/tarantoolctl.in sergeyb
2020-05-29 16:35   ` Igor Munkin
2020-06-01 14:10   ` Alexander Turenko
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 05/25] Fix luacheck warnings in src/lua/ sergeyb
2020-05-29 16:51   ` Igor Munkin
2020-05-29 19:13     ` Igor Munkin
2020-05-30 12:15       ` Sergey Bronnikov
2020-06-01  9:43         ` Igor Munkin
2020-06-01 10:36           ` Sergey Bronnikov
2020-06-01  9:38     ` Sergey Bronnikov
2020-06-01 14:47   ` Alexander Turenko
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 06/25] Fix luacheck warnings in src/box/lua/ sergeyb
2020-05-29 19:11   ` Igor Munkin
2020-05-30 12:22     ` Sergey Bronnikov
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 07/25] Supress luacheck warnings in test/app sergeyb
2020-06-01 10:11   ` Igor Munkin
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 08/25] Fix luacheck warnings in test/app-tap sergeyb
2020-06-01 11:41   ` Igor Munkin
2020-07-16 11:44     ` Sergey Bronnikov
2020-07-16 12:42       ` Igor Munkin
2020-07-16 13:25         ` Sergey Bronnikov
2020-06-01 13:37   ` Alexander Turenko
2020-06-01 16:37     ` Igor Munkin
2020-06-01 17:13       ` Alexander Turenko
2020-06-01 17:38         ` Igor Munkin
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 09/25] Fix luacheck warnings in test/box sergeyb
2020-06-01 16:06   ` Igor Munkin
2020-07-16 13:23     ` Sergey Bronnikov
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 10/25] Fix luacheck warnings in test/box-py sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 11/25] Fix luacheck warnings in test/box-tap sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 12/25] Fix luacheck warnings in test/engine sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 13/25] Fix luacheck warnings in test/engine_long sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 14/25] Fix luacheck warnings in test/long_run-py sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 15/25] Fix luacheck warnings in test/replication sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 16/25] Fix luacheck warnings in test/replication-py sergeyb
2020-05-29 15:09 ` sergeyb [this message]
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 18/25] Fix luacheck warnings in test/sql-tap sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 19/25] Fix luacheck warnings in test/swim sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 20/25] Fix luacheck warnings in test/vinyl sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 21/25] Fix luacheck warnings in test/wal_off sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 22/25] Fix luacheck warnings in test/xlog sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 23/25] Fix luacheck warnings in test/xlog-py sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 24/25] Add luacheck supressions for luajit tests sergeyb
2020-05-29 15:09 ` [Tarantool-patches] [PATCH v6 25/25] luajit: bump new version sergeyb
2020-06-01 17:08 ` [Tarantool-patches] [PATCH v6 00/25] Add static analysis with luacheck Vladislav Shpilevoy
2020-06-01 17:29   ` Alexander Turenko
2020-06-01 18:13     ` Igor Munkin
2020-06-02 14:42 ` Alexander Turenko
2020-06-02 15:58   ` Igor Munkin

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=91d3067bdea24ca0d8470d3b474f3c9d8d23679c.1590764168.git.sergeyb@tarantool.org \
    --to=sergeyb@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=imun@tarantool.org \
    --cc=o.piskunov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v6 17/25] Fix luacheck warnings in test/sql' \
    /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