Tarantool development patches archive
 help / color / mirror / Atom feed
From: Leonid Vasiliev <lvasiliev@tarantool.org>
To: Artem Starshov <artemreyt@tarantool.org>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH] Fix luacheck warning W122 in extra/dist/tarantoolctl.in
Date: Thu, 8 Oct 2020 12:22:56 +0300	[thread overview]
Message-ID: <cae6b35d-8ec1-5509-f335-065e8f548f81@tarantool.org> (raw)
In-Reply-To: <3258554a12b614f5acc4e18ae02c7c0029489c6f.1602077294.git.artemreyt@tarantool.org>

Hi! Thank you for the patch.
Code changes are ok. See some comments on the decoration of the patch
below:

According to 
https://github.com/tarantool/tarantool/wiki/Code-review-procedure#commit-message:
- "Description is what the patch does, started from lowercase letter..."
- "Commit title should be of a form <subsystem>: <description>."
   (luacheck:...)

I guess nobody remembers the luacheck warning codes. You can describe
the warning in detail in the "body" of a commit message, don't need to
put it in the "header".
I think the file name will be enough, don't need to write the full path.


On 07.10.2020 16:33, Artem Starshov wrote:
> Changed passing global variable arg to function find_instance_name(arg) instead of passing arg[0] and arg[2] separately.

According to 
https://github.com/tarantool/tarantool/wiki/Code-review-procedure#commit-message:
- "Commit message should fit 72 symbols line width."

> And removed exception in .luacheckrc for file /extra/dist/tarantoolctl.in.
> 
> This change only solves linter warning, nothing else

- Add link on the ticket (Fixed #number_of_the_ticket).

> ---

Please add a link to the ticket and your branch.

>   .luacheckrc                |  6 ------
>   extra/dist/tarantoolctl.in | 16 ++++++++--------
>   2 files changed, 8 insertions(+), 14 deletions(-)
> 
> diff --git a/.luacheckrc b/.luacheckrc
> index 994d29956..2a652cd06 100644
> --- a/.luacheckrc
> +++ b/.luacheckrc
> @@ -37,12 +37,6 @@ exclude_files = {
>       ".git/**/*.lua",
>   }
>   
> -files["extra/dist/tarantoolctl.in"] = {
> -    ignore = {
> -        -- https://github.com/tarantool/tarantool/issues/4929
> -        "122",
> -    },
> -}
>   files["src/lua/help.lua"] = {
>       -- Globals defined for interactive mode.
>       globals = {"help", "tutorial"},
> diff --git a/extra/dist/tarantoolctl.in b/extra/dist/tarantoolctl.in
> index 90caf58ad..0726e7f46 100755
> --- a/extra/dist/tarantoolctl.in
> +++ b/extra/dist/tarantoolctl.in
> @@ -202,19 +202,19 @@ end
>   -- In case there is no explicit instance name, check whether arg[0] is a
>   -- symlink. In that case, the name of the symlink is the instance name.
>   --
> -local function find_instance_name(arg0, arg2)
> -    if arg2 ~= nil then
> -        return fio.basename(arg2, '.lua')
> +local function find_instance_name(arg)
> +    if arg[2] ~= nil then
> +        return fio.basename(arg[2], '.lua')
>       end
> -    local istat = fio.lstat(arg0)
> +    local istat = fio.lstat(arg[0])
>       if istat == nil then
> -        log.error("Can't stat %s: %s", arg0, errno.strerror())
> +        log.error("Can't stat %s: %s", arg[0], errno.strerror())
>           os.exit(1)
>       end
>       if not istat:is_link() then usage(command_name) end
> -    arg[2] = arg0
> +    arg[2] = arg[0]
>       linkmode = true
> -    return fio.basename(arg0, '.lua')
> +    return fio.basename(arg[0], '.lua')
>   end
>   
>   local function mkdir(dirname)
> @@ -971,7 +971,7 @@ local function process_remote(cmd_function)
>   end
>   
>   local function process_local(cmd_function)
> -    instance_name = find_instance_name(arg[0], arg[2])
> +    instance_name = find_instance_name(arg)
>   
>       default_file = find_default_file()
>       load_default_file(default_file)
> 

      reply	other threads:[~2020-10-08  9:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-07 13:33 Artem Starshov
2020-10-08  9:22 ` Leonid Vasiliev [this message]

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=cae6b35d-8ec1-5509-f335-065e8f548f81@tarantool.org \
    --to=lvasiliev@tarantool.org \
    --cc=artemreyt@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] Fix luacheck warning W122 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