Tarantool development patches archive
 help / color / mirror / Atom feed
From: Sergey Bronnikov <sergeyb@tarantool.org>
To: Artem <artemreyt@tarantool.org>,
	tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH v2] luacheck: change global vars to local in sql-tap
Date: Wed, 9 Dec 2020 09:13:17 +0300	[thread overview]
Message-ID: <0a511e3b-b103-e619-7a90-a31e2164ac17@tarantool.org> (raw)
In-Reply-To: <d3abbdbd-54d2-7f32-6bd0-8e46d0a1f910@tarantool.org>

[-- Attachment #1: Type: text/plain, Size: 4601 bytes --]

Hello, Artem!

LGTM

On 26.11.2020 15:19, Artem wrote:
>
> Sergey, thanks for the review!
>
> 24.11.2020 21:57, Sergey Bronnikov пишет:
>>
>> Hi, Artem!
>>
>> thanks for the patch! See 2 comment below.
>>
>> On 20.11.2020 19:34, Artem Starshov wrote:
>>> Fixed luacheck warning 111 (setting non-standard global variable)
>>> in test/sql-tap directory.
>>> Enabled this directory for checking W111 in
>>> config file(.luacheckrc).
>>>
>>> Changed almost all variables in test/sql-tap from globals
>>> to locals. In any cases, where variables need to be global,
>>> added inline comments for luacheck.
>>>
>>> Fixes #5173
>>> Part-of #5464
>>> ---
>>
>> Please don't forget to place a branch name, issue number.
>>
>> I believe both are the same as in previous mail:
>>
>> >> Branch: 
>> https://github.com/tarantool/tarantool/tree/artemreyt/gh-5173-fix-luacheck-warnings-sql-tap 
>> >> Issue: https://github.com/tarantool/tarantool/issues/5173
>>
>> <snipped>
>>
>>> diff --git a/.luacheckrc b/.luacheckrc
>>> index 2a652cd06..174bfdf25 100644
>>> --- a/.luacheckrc
>>> +++ b/.luacheckrc
>>> @@ -31,12 +31,67 @@ exclude_files = {
>>>       -- Third-party source code.
>>>       "src/box/lua/serpent.lua",
>>>       "test-run/**/*.lua",
>>> -    "test/**/*.lua",
>>> +    "test/app/**/*.lua",
>>> +    "test/app-tap/**/*.lua",
>>> +    "test/box/**/*.lua",
>>> +    "test/box-py/**/*.lua",
>>> +    "test/box-tap/**/*.lua",
>>> +    "test/engine/**/*.lua",
>>> +    "test/engine_long/**/*.lua",
>>> +    "test/long_run-py/**/*.lua",
>>> +    "test/luajit-tap/**/*.lua",
>>> +    "test/replication/**/*.lua",
>>> +    "test/replication-py/**/*.lua",
>>> +    "test/sql/**/*.lua",
>>> +    "test/swim/**/*.lua",
>>> +    "test/var/**/*.lua",
>>> +    "test/vinyl/**/*.lua",
>>> +    "test/wal_off/**/*.lua",
>>> +    "test/xlog/**/*.lua",
>>> +    "test/xlog-py/**/*.lua",
>>>       "third_party/**/*.lua",
>>>       ".rocks/**/*.lua",
>>>       ".git/**/*.lua",
>>>   }
>>>   
>>> +--
>>> +-- gh-5464: Fix luacheck warnings in test/sql-tap
>>> +--
> 1. Removed on the branch.
>> 1. Number of ticket that will be closed after merging this patch is 
>> useless here.
>>> +files["test/sql-tap/**/*.lua"] = {
>>> +    ignore = {
>>> +        -- Accessing an undefined global variable.
>>> +        "113",
>>> +        -- Unused local variable.
>>> +        "211",
>>> +        -- Unused argument.
>>> +        "212",
>>> +        -- Unused loop variable.
>>> +        "213",
>>> +        -- Local variable is set but never accessed.
>>> +        "231",
>>> +        -- "Value assigned to a local variable is unused."
>>> +        "311",
>>> +        -- Unreachable code.
>>> +        "511",
>>> +        -- Loop can be executed at most once.
>>> +        "512",
>>> +        -- An empty if branch.
>>> +        "542",
>>> +        -- A line consists of nothing but whitespace.
>>> +        "611",
>>> +        -- A line contains trailing whitespace.
>>> +        "612",
>>> +        -- Trailing whitespace in a string.
>>> +        "613",
>>> +        -- Trailing whitespace in a comment.
>>> +        "614",
>>> +        -- Inconsistent indentation (SPACE followed by TAB).
>>> +        "621",
>>> +        -- Line is too long.
>>> +        "631"
>>> +    }
>>> +}
>>> +
>>>   files["src/lua/help.lua"] = {
>>>       -- Globals defined for interactive mode.
>>>       globals = {"help", "tutorial"},
>>> diff --git a/test/sql-tap/aggnested.test.lua b/test/sql-tap/aggnested.test.lua
>>> index 67a9ba891..8a79e0df2 100755
>>> --- a/test/sql-tap/aggnested.test.lua
>>> +++ b/test/sql-tap/aggnested.test.lua
>>> @@ -1,5 +1,5 @@
>>>   #!/usr/bin/env tarantool
>>> -test = require("sqltester")
>>> +local test = require("sqltester")
>>>   test:plan(7)
>>>   
>>>   --!./tcltestrunner.lua
>>> diff --git a/test/sql-tap/alias.test.lua b/test/sql-tap/alias.test.lua
>>> index 75391b305..8181b5ed5 100755
>>> --- a/test/sql-tap/alias.test.lua
>>> +++ b/test/sql-tap/alias.test.lua
>>> @@ -1,5 +1,5 @@
>>>   #!/usr/bin/env tarantool
>>> -test = require("sqltester")
>>> +local test = require("sqltester")
>>>   test:plan(9)
>>>   
>>>   --!./tcltestrunner.lua
>>> @@ -24,6 +24,7 @@ test:plan(9)
>>>   -- A procedure to return a sequence of increasing integers.
>>>   --
>>>   
>>> +-- luacheck: globals counter
>>>   counter = 0
>>>   
>
> 2. It's a bug, created a ticket here:
>
> https://github.com/mpeterv/luacheck/issues/210
>
>> 2. In [1] I asked to place supressions on the same line with code
>>
>> 1. 
>> https://lists.tarantool.org/pipermail/tarantool-patches/2020-November/020606.html
>>
>> <snipped> 

[-- Attachment #2: Type: text/html, Size: 7276 bytes --]

  parent reply	other threads:[~2020-12-09  6:13 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20 16:34 Artem Starshov
2020-11-24 18:57 ` Sergey Bronnikov
     [not found]   ` <d3abbdbd-54d2-7f32-6bd0-8e46d0a1f910@tarantool.org>
2020-12-09  6:13     ` Sergey Bronnikov [this message]
2020-12-08 23:30 ` Alexander Turenko

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=0a511e3b-b103-e619-7a90-a31e2164ac17@tarantool.org \
    --to=sergeyb@tarantool.org \
    --cc=artemreyt@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2] luacheck: change global vars to local in sql-tap' \
    /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