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 6712064672; Wed, 13 Jan 2021 17:35:26 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 6712064672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1610548526; bh=Mr6Y8pyXleGa6heZGsl/eJRQbmmZlNnAv03idXxgiak=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=loRWkBP/Q+bHMmu0dTw8sObGxJFrDbt4wtolN3P0tkcKTca5xT9NW1UvWIkWieC4U eAu3TWRynOOgsG6Eet//EciEdBPyiX1CwH8YZOWZKaCcsvz6n3Wi+JbikYyQNwjqCF pdXRPr7j7kpnWcw2/kRXztz1D3hrVKzbh7mqwVt4= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 AAB7164672 for ; Wed, 13 Jan 2021 17:35:24 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org AAB7164672 Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1kzhF5-0001VK-M0; Wed, 13 Jan 2021 17:35:24 +0300 To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Date: Wed, 13 Jan 2021 17:35:17 +0300 Message-Id: X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D0E79FBC973162CD81CC0669AF3BE2AC14A0BAA29BC1501600894C459B0CD1B98B25B90D097EC60FA2B4FE541428247BF7AF03502216EE04F70E9905CEA40A81 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE7081BBE264C6D7F42EA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063781BF90BB6B3E56078638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC4AF84131CB0EA602144EB67F92C7BBD3EF31087B299C1079389733CBF5DBD5E913377AFFFEAFD269A417C69337E82CC2CC7F00164DA146DAFE8445B8C89999729449624AB7ADAF37F6B57BC7E64490611E7FA7ABCAF51C92A417C69337E82CC2CC7F00164DA146DA6F5DAA56C3B73B23C77107234E2CFBA567F23339F89546C55F5C1EE8F4F765FC3B6387817AF5331475ECD9A6C639B01BBD4B6F7A4D31EC0BC0CAF46E325F83A522CA9DD8327EE4931B544F03EFBC4D5724B591B534DDBB47C4224003CC836476C0CAF46E325F83A50BF2EBBBDD9D6B0F05F538519369F3743B503F486389A921A5CC5B56E945C8DA X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8186998911F362727C414F749A5E30D975CD9CBB3A052EDBDE593C4DCD73242EAE017042AF74E0B84699C2B6934AE262D3EE7EAB7254005DCED5177E3BD826A77771E0A4E2319210D9B64D260DF9561598F01A9E91200F654B03031C89702B531498E8E86DC7131B365E7726E8460B7C23C X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D346F8291983715AC66C9F10F1DA039BC8F5A1E654EF25255D5678FD0715EC808595EAF665B6AD165D81D7E09C32AA3244C7DA4E42389557BFDA7BA34A83D762A96B038C9161EF167A1927AC6DF5659F194 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj4exXbGs3yZor2sxTABdGKA== X-Mailru-Sender: 689FA8AB762F73937240DDB2502DDB70B4026E77CFD5579233BDF631B227FF5EDD788429FD8613638ED9BB8B05EE7B3AFB559BB5D741EB96D19CD4E7312BAA970A04DAD6CC59E33667EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH v7] test: fix luacheck warnings in test/long_run-py 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: sergeyb@tarantool.org Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" From: Sergey Bronnikov Closes #5460 Reviewed-by: Vladislav Shpilevoy Reviewed-by: Igor Munkin Co-authored-by: Vladislav Shpilevoy Co-authored-by: Igor Munkin --- Changelog v7: - updated an exclusion mask in .luacheckrc Changelog v6: - splitted patch in test/ for patches per sub-directory - adjusted supressions in .luacheckrc - fixed formatting issues in .luacheckrc Gitlab CI: https://gitlab.com/tarantool/tarantool/-/pipelines/241108315 Issue: https://github.com/tarantool/tarantool/issues/5460 Branch: ligurio/gh-5460-luacheck-warnings-test-long_run-py .luacheckrc | 2 +- test/long_run-py/lua/finalizers.lua | 8 +++----- test/long_run-py/suite.lua | 16 +++++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 4b829f3dc..68736d8db 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -37,7 +37,7 @@ exclude_files = { "test/box-tap/**/*.lua", "test/engine/**/*.lua", "test/engine_long/**/*.lua", - "test/long_run-py/**/*.lua", + "test/long_run-py/lua/finalizers.lua", "test/luajit-tap/**/*.lua", "test/replication/**/*.lua", "test/replication-py/**/*.lua", diff --git a/test/long_run-py/lua/finalizers.lua b/test/long_run-py/lua/finalizers.lua index 69146a323..cb6400363 100644 --- a/test/long_run-py/lua/finalizers.lua +++ b/test/long_run-py/lua/finalizers.lua @@ -1,19 +1,17 @@ #!/usr/bin/env tarantool -function on_gc(t) +local function on_gc() end; -function test_finalizers() +local function test_finalizers() local result = {} local i = 1 local ffi = require('ffi') while true do - result[i] = ffi.gc(ffi.cast('void *', 0), on_gc) + local result[i] = ffi.gc(ffi.cast('void *', 0), on_gc) i = i + 1 end - return "done" end; test_finalizers() test_finalizers() - diff --git a/test/long_run-py/suite.lua b/test/long_run-py/suite.lua index 0b33dec7d..7a09dd2b8 100644 --- a/test/long_run-py/suite.lua +++ b/test/long_run-py/suite.lua @@ -1,17 +1,16 @@ -function string_function() +local function string_function() local random_number local random_string random_string = "" - for x = 1,20,1 do + for _ = 1,20,1 do random_number = math.random(65, 90) random_string = random_string .. string.char(random_number) end return random_string end -function delete_replace_update(engine_name) - local string_value +local function delete_replace_update(engine_name) if (box.space._space.index.name:select{'tester'}[1] ~= nil) then box.space.tester:drop() end @@ -41,7 +40,6 @@ function delete_replace_update(engine_name) random_number = math.random(1,6) string_value_3 = string_function() --- print('<'..counter..'> [' .. random_number .. '] value_2: ' .. string_value_2 .. ' value_3: ' .. string_value_3) if random_number == 1 then box.space.tester:delete{string_value_2} end @@ -71,8 +69,7 @@ function delete_replace_update(engine_name) return {counter, random_number, string_value_2, string_value_3} end -function delete_insert(engine_name) - local string_value +local function delete_insert(engine_name) if (box.space._space.index.name:select{'tester'}[1] ~= nil) then box.space.tester:drop() end @@ -109,3 +106,8 @@ function delete_insert(engine_name) box.space.tester:drop() return {counter, string_value_2} end + +return { + delete_replace_update = delete_replace_update; + delete_insert = delete_insert; +} -- 2.25.1