Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov <sergeyb@tarantool.org>
To: tarantool-patches@dev.tarantool.org, avtikhon@tarantool.org,
	alexander.turenko@tarantool.org, o.piskunov@tarantool.org
Subject: [Tarantool-patches] [PATCH 4/6] Fix luacheck warnings in extra/dist/tarantoolctl.in
Date: Tue, 14 Apr 2020 10:58:12 +0300	[thread overview]
Message-ID: <df73ea556e3a8c7558abf7dd91150b07daed6eb6.1586849129.git.sergeyb@tarantool.org> (raw)
In-Reply-To: <cover.1586849129.git.sergeyb@tarantool.org>

Closes #4681

Reviewed-by: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
---

 extra/dist/tarantoolctl.in | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
index f5a912ccd..d7f098735 100755
--- a/extra/dist/tarantoolctl.in
+++ b/extra/dist/tarantoolctl.in
@@ -46,7 +46,6 @@ local instance_dir
 local default_cfg
 local positional_arguments
 local keyword_arguments
-local lua_arguments = arg
 local language
 
 -- function for printing usage reference
@@ -64,7 +63,7 @@ end
 
 local function check_user_level()
     local uid = os.getenv('UID')
-    local udir = nil
+    local udir
     if uid == 0 or os.getenv("NOTIFY_SOCKET") then
         return nil
     end
@@ -790,7 +789,7 @@ end
 local function eval()
     local console_sock_path = uri.parse(console_sock).service
     local filename = arg[3]
-    local code = nil
+    local code
     if filename == nil then
         if stdin_isatty() then
             log.error("Usage:")
@@ -848,7 +847,6 @@ end
 -- xlog / snap file, so even when it stops on LSN >= @a opts.to on
 -- a current file a next file will be processed.
 local function filter_xlog(gen, param, state, opts, cb)
-    local spaces = opts.spaces
     local from, to, spaces = opts.from, opts.to, opts.space
     local show_system, replicas = opts['show-system'], opts.replica
 
@@ -875,7 +873,7 @@ local function cat()
     local cat_format = opts.format
     local format_cb = cat_formats[cat_format]
     local is_printed = false
-    for id, file in ipairs(positional_arguments) do
+    for _, file in ipairs(positional_arguments) do
         log.error("Processing file '%s'", file)
         local gen, param, state = xlog.pairs(file)
         filter_xlog(gen, param, state, opts, function(record)
@@ -901,7 +899,7 @@ local function play()
     if not remote:wait_connected() then
         error(("Error while connecting to host '%s'"):format(uri))
     end
-    for id, file in ipairs(positional_arguments) do
+    for _, file in ipairs(positional_arguments) do
         log.info(("Processing file '%s'"):format(file))
         local gen, param, state = xlog.pairs(file)
         filter_xlog(gen, param, state, opts, function(record)
@@ -923,7 +921,7 @@ local function play()
 end
 
 local function find_arg(name_arg)
-    for i, key in ipairs(arg) do
+    for _, key in ipairs(arg) do
         if key:find(name_arg) ~= nil then
             return key
         end
@@ -937,7 +935,7 @@ local function rocks()
     local util = require("luarocks.util")
     local command_line = require("luarocks.cmd")
     local options = keyword_arguments
-    local key = nil
+    local key
     if options["only-server"] ~= nil then
         key = find_arg("only%-server")
     else
@@ -954,7 +952,7 @@ local function rocks()
     end
 
     -- Tweak help messages
-    util.see_help = function(command, program)
+    util.see_help = function()
         -- TODO: print extended help message here
         return "See Tarantool documentation for help."
     end
@@ -1321,7 +1319,7 @@ local function usage_command(name, cmd)
     if type(header) == 'string' then
         header = { header }
     end
-    for no, line in ipairs(header) do
+    for _, line in ipairs(header) do
         log.error("    " .. line, name)
     end
 end
-- 
2.23.0


-- 
sergeyb@

  parent reply	other threads:[~2020-04-14  7:58 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-14  7:55 [Tarantool-patches] [PATCH v3 0/6] Add static analysis with luacheck Sergey Bronnikov
2020-04-14  7:56 ` [Tarantool-patches] [PATCH 1/6] Fix luacheck warnings in src/lua/ Sergey Bronnikov
2020-04-14 23:29   ` Vladislav Shpilevoy
2020-04-15 20:51     ` Igor Munkin
2020-04-15 21:40       ` Vladislav Shpilevoy
2020-04-17  9:07       ` Sergey Bronnikov
2020-04-17  9:09     ` Sergey Bronnikov
2020-04-15 20:51   ` Igor Munkin
2020-04-15 21:46     ` Vladislav Shpilevoy
2020-04-16 13:52       ` Igor Munkin
2020-04-17  9:26     ` Sergey Bronnikov
2020-04-17 12:13       ` Igor Munkin
2020-04-14  7:57 ` [Tarantool-patches] [PATCH 2/6] Fix luacheck warnings in test/ Sergey Bronnikov
2020-04-14 23:29   ` Vladislav Shpilevoy
2020-04-17 12:05     ` Igor Munkin
2020-04-17 19:51       ` Sergey Bronnikov
2020-04-17 19:47     ` Sergey Bronnikov
2020-04-16 13:43   ` Igor Munkin
2020-04-14  7:57 ` [Tarantool-patches] [PATCH 3/6] Fix luacheck warnings in src/box/lua/ Sergey Bronnikov
2020-04-14 23:30   ` Vladislav Shpilevoy
2020-04-14  7:58 ` Sergey Bronnikov [this message]
2020-04-14 23:30   ` [Tarantool-patches] [PATCH 4/6] Fix luacheck warnings in extra/dist/tarantoolctl.in Vladislav Shpilevoy
2020-04-15 15:35   ` Igor Munkin
2020-04-14  8:01 ` [Tarantool-patches] [PATCH 5/6] Add luacheck config Sergey Bronnikov
2020-04-14 23:30   ` Vladislav Shpilevoy
2020-04-14  8:01 ` [Tarantool-patches] [PATCH 6/6] gitlab-ci: enable static analysis with luacheck Sergey Bronnikov
2020-04-14 23:30 ` [Tarantool-patches] [PATCH v3 7/6] schema: fix index promotion to functional index Vladislav Shpilevoy
2020-04-14 23:30 ` [Tarantool-patches] [PATCH v3 8/6] schema: fix internal symbols dangling in _G Vladislav Shpilevoy

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=df73ea556e3a8c7558abf7dd91150b07daed6eb6.1586849129.git.sergeyb@tarantool.org \
    --to=sergeyb@tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=avtikhon@tarantool.org \
    --cc=o.piskunov@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH 4/6] Fix luacheck warnings in extra/dist/tarantoolctl.in' \
    /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