From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng1.m.smailru.net (smtpng1.m.smailru.net [94.100.181.251]) (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 D45874696C3 for ; Thu, 16 Apr 2020 17:00:03 +0300 (MSK) Date: Thu, 16 Apr 2020 16:52:56 +0300 From: Igor Munkin Message-ID: <20200416135256.GI8314@tarantool.org> References: <56290abaaa1850a223eac0fa7165bcb9f890501d.1586849129.git.sergeyb@tarantool.org> <20200415205102.GF8314@tarantool.org> <7f693dc4-5103-1481-082c-802f96c722cd@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <7f693dc4-5103-1481-082c-802f96c722cd@tarantool.org> Subject: Re: [Tarantool-patches] [PATCH 1/6] Fix luacheck warnings in src/lua/ List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vladislav Shpilevoy Cc: o.piskunov@tarantool.org, tarantool-patches@dev.tarantool.org Vlad, On 15.04.20, Vladislav Shpilevoy wrote: > >> @@ -428,7 +428,7 @@ local public_methods = { > >> } > >> > >> local module_mt = { > >> - __serialize = function(s) > >> + __serialize = function() > >> return public_methods > >> end, > >> __index = public_methods > > > > I see no reasons to leave other W212[unused argument self] occurences. > > Here is a diff: > > > > ================================================================================ > > > > diff --git a/src/lua/crypto.lua b/src/lua/crypto.lua > > index c0eb0d303..6a7ee53f0 100644 > > --- a/src/lua/crypto.lua > > +++ b/src/lua/crypto.lua > > @@ -318,7 +318,7 @@ for class, digest in pairs(digests) do > > digest_api[class] = setmetatable({ > > new = function () return digest_new(digest) end > > }, { > > - __call = function (self, str) > > + __call = function (_, str) > > I would better avoid such changes. They make it harder to understand > what the function takes as arguments. Luacheck in these cases basically > dictates to us how to name variables, because nothing is removed here. > The variable is just renamed to a less understandable name. Well, your point also sounds rational and I agree with you since code is written for us not for luacheck. I guess we need investigate can we suppress globally only unused args with the name but still reports others? Otherwise we can suppress it inline. Chunk-wide suppression can lead to masked/false-negative errors. -- Best regards, IM