From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (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 C200F445320 for ; Tue, 14 Jul 2020 01:59:11 +0300 (MSK) References: From: Vladislav Shpilevoy Message-ID: Date: Tue, 14 Jul 2020 00:59:09 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 5/6] Fix luacheck warnings in src/lua/ List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sergeyb@tarantool.org, tarantool-patches@dev.tarantool.org, imun@tarantool.org Cc: alexander.turenko@tarantool.org Hi! Thanks for the fixes! I've force pushed the following changes: ==================== diff --git a/src/lua/fio.lua b/src/lua/fio.lua index b31311b7b..954c44cdf 100644 --- a/src/lua/fio.lua +++ b/src/lua/fio.lua @@ -378,7 +378,7 @@ fio.mktree = function(path, mode) end path = fio.abspath(path) - path = string.gsub(path, '^/', '') + local path = string.gsub(path, '^/', '') ==================== As I pointed out already, all kinds of redefinition warnings were disabled. No need to touch them. ==================== local dirs = string.split(path, "/") local current_dir = "/" diff --git a/src/lua/init.lua b/src/lua/init.lua index 280ecc03f..9e3c813c3 100644 --- a/src/lua/init.lua +++ b/src/lua/init.lua @@ -80,7 +80,7 @@ dostring = function(s, ...) end local fiber = require("fiber") -local exit = function(code) +local function exit(code) ==================== Easier to grep, and just looks more natural. ==================== code = (type(code) == 'number') and code or 0 ffi.C.tarantool_exit(code) -- Make sure we yield even if the code after diff --git a/src/lua/log.lua b/src/lua/log.lua index bf0e4283c..cfd83f592 100644 --- a/src/lua/log.lua +++ b/src/lua/log.lua @@ -459,7 +459,7 @@ local function reload_cfg(cfg) end -- Load or reload configuration via log.cfg({}) call. -local function load_cfg(oldcf, cfg) -- luacheck: no unused args +local function load_cfg(self, cfg) ==================== The function is a __call method of the configuration table. So the first argument is always self. And it is legal to rename it. Also this is preferable since we force 'self' as a special name in our luacheck config. ==================== cfg = cfg or {} -- log option might be zero length string, which