From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.mail.ru (smtp1.mail.ru [94.100.179.111]) (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 097B644532C for ; Thu, 16 Jul 2020 17:13:42 +0300 (MSK) From: sergeyb@tarantool.org Date: Thu, 16 Jul 2020 17:11:40 +0300 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 11/19] Fix luacheck warnings in test/sql List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org, imun@tarantool.org Cc: alexander.turenko@tarantool.org From: Sergey Bronnikov Part of #4681 Reviewed-by: Vladislav Shpilevoy Reviewed-by: Igor Munkin --- .luacheckrc | 36 +++++++++++++++++++++++++++++++++- test/sql/lua/sql_tokenizer.lua | 2 +- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 789958fc8..646c844d6 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -45,7 +45,7 @@ exclude_files = { "test/engine_long/*.test.lua", "test/replication/*.test.lua", "test/sql-tap/**/*.lua", - "test/sql/**/*.lua", + "test/sql/*.test.lua", "test/swim/**/*.lua", "test/var/**/*.lua", "test/vinyl/**/*.lua", @@ -202,3 +202,37 @@ files["test/replication/lua/fast_replica.lua"] = { "wait_all", }, } +files["test/sql-tap/*.lua"] = { + ignore = { + -- Setting an undefined global variable. + -- https://github.com/tarantool/tarantool/issues/5173 + "111", + -- Accessing an undefined global variable. + -- https://github.com/tarantool/tarantool/issues/5174 + "113", + -- Unused local variable. + -- https://github.com/tarantool/tarantool/issues/5175 + "211", + -- A line consists of nothing but whitespace. + -- https://github.com/tarantool/tarantool/issues/5176 + "611", + -- A line contains trailing whitespace. + -- https://github.com/tarantool/tarantool/issues/5177 + "612", + -- Trailing whitespace in a string. + -- https://github.com/tarantool/tarantool/issues/5178 + "613", + -- Trailing whitespace in a comment. + -- https://github.com/tarantool/tarantool/issues/5179 + "614", + -- Inconsistent indentation (SPACE followed by TAB). + -- https://github.com/tarantool/tarantool/issues/5180 + "621", + -- Line is too long. + -- https://github.com/tarantool/tarantool/issues/5181 + "631" + } +} +files["test/sql-tap/lua/sqltester.lua"] = { + globals = {"table_match_regex_p"} +} 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) -- 2.26.2