From: Igor Munkin <imun@tarantool.org> To: sergeyb@tarantool.org Cc: o.piskunov@tarantool.org, tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org Subject: Re: [Tarantool-patches] [PATCH v4 10/10] luajit: Fix warnings spotted by luacheck Date: Tue, 21 Apr 2020 22:33:01 +0300 [thread overview] Message-ID: <20200421193301.GD8314@tarantool.org> (raw) In-Reply-To: <20200421140258.42949-1-sergeyb@tarantool.org> Sergey, Thanks for the patch! Please adjust the commit subject considering our contributors guide[1]. Since the commit is for tarantool/luajit repo I propose the following: | test: fix warnings spotted by luacheck Also, It would be nice to mention in commit message that luacheck is integrated in tarantool CI pipeline that respect .luacheckrc in tarantool repo (since jit global is suppressed there). Furthermore I applied your patch and as a result of manual luacheck run in test directory I faced the following warnings: | $ luacheck *.lua --globals=jit | Checking gh-3196-incorrect-string-length.test.lua OK | Checking gh-4427-ffi-sandwich.test.lua OK | Checking gh-4476-fix-string-find-recording.test.lua 1 warning | | gh-4476-fix-string-find-recording.test.lua:54:11: variable s is never accessed | | Checking gh-4773-tonumber-fail-on-NUL-char.test.lua OK | Checking lj-494-table-chain-infinite-loop.test.lua OK | Checking lj-505-fold-no-strref-for-ptrdiff.test.lua OK | Checking lj-524-fold-conv-respect-src-irt.test.lua OK | Checking lj-flush-on-trace.test.lua OK | Checking or-232-unsink-64-kptr.test.lua 1 warning | | or-232-unsink-64-kptr.test.lua:34:18: empty if branch | | Checking utils.lua OK | | Total: 2 warnings / 0 errors in 10 files Here is the diff with the fix: ================================================================================ diff --git a/test/gh-4476-fix-string-find-recording.test.lua b/test/gh-4476-fix-string-find-recording.test.lua index 209090a..ef2bb97 100755 --- a/test/gh-4476-fix-string-find-recording.test.lua +++ b/test/gh-4476-fix-string-find-recording.test.lua @@ -51,13 +51,13 @@ local err = [[module 'kit.1.10.3-136' not found: no file '/usr/local/lib64/lua/5.1/kit.so' no file '/usr/lib64/lua/5.1/kit.so']] -local at, s, e +local _, at, e local count_vm = 0 jit.off() repeat - s, e = err:find("\n\t", at, true) + _, e = err:find("\n\t", at, true) at = e count_vm = count_vm + 1 until not e @@ -68,7 +68,7 @@ jit.on() jit.opt.start(0, 'hotloop=1') repeat - s, e = err:find("\n\t", at, true) + _, e = err:find("\n\t", at, true) at = e count_jit = count_jit + 1 assert(count_jit <= count_vm, "Trace goes in cycles") diff --git a/test/or-232-unsink-64-kptr.test.lua b/test/or-232-unsink-64-kptr.test.lua index d9b3f05..0178a6e 100755 --- a/test/or-232-unsink-64-kptr.test.lua +++ b/test/or-232-unsink-64-kptr.test.lua @@ -31,6 +31,7 @@ local array = ffi.new("struct { int x; } [1]") local function fn(i) local struct = array[0] -- Load pointer that the JIT will constify. + -- luacheck: ignore if i == 1000 then end -- Force trace exit when i==1000. struct.x = 0 -- Ensure that 'struct' is live after exit. end ================================================================================ I see no warnings after applying this diff. On 21.04.20, sergeyb@tarantool.org wrote: > From: Sergey Bronnikov <sergeyb@tarantool.org> > > --- > .../lj-494-table-chain-infinite-loop.test.lua | 26 +++++++++---------- > 1 file changed, 13 insertions(+), 13 deletions(-) > <snipped> > -- > 2.18.2 > [1]: https://www.tarantool.io/en/doc/2.2/dev_guide/developer_guidelines/ -- Best regards, IM
next prev parent reply other threads:[~2020-04-21 19:40 UTC|newest] Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-04-21 14:00 [Tarantool-patches] [PATCH v4 0/10] Add static analysis with luacheck sergeyb 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 1/10] Add initial luacheck config sergeyb 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 2/10] gitlab-ci: enable static analysis with luacheck sergeyb 2020-04-21 20:04 ` Alexander Tikhonov 2020-04-22 8:09 ` Sergey Bronnikov 2020-04-22 8:11 ` Kirill Yukhin 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 3/10] Fix luacheck warnings in extra/dist/tarantoolctl.in sergeyb 2020-04-23 11:40 ` Igor Munkin 2020-04-24 8:02 ` Sergey Bronnikov 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 4/10] Fix luacheck warnings in src/lua/ sergeyb 2020-04-23 14:13 ` Igor Munkin 2020-04-24 9:12 ` Sergey Bronnikov 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 5/10] Fix luacheck warnings in src/box/lua/ sergeyb 2020-04-23 22:54 ` Igor Munkin 2020-05-07 10:32 ` Sergey Bronnikov 2020-05-07 14:34 ` Sergey Bronnikov 2020-05-07 10:52 ` Sergey Bronnikov 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 6/10] Fix luacheck warnings in test/ sergeyb 2020-04-27 14:38 ` Igor Munkin 2020-05-06 16:16 ` Sergey Bronnikov 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 7/10] schema: fix index promotion to functional index sergeyb 2020-04-23 23:24 ` Igor Munkin 2020-04-23 23:29 ` Igor Munkin 2020-04-28 23:19 ` Vladislav Shpilevoy 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 8/10] schema: fix internal symbols dangling in _G sergeyb 2020-04-21 14:13 ` Oleg Babin 2020-04-21 14:45 ` Sergey Bronnikov 2020-04-21 19:52 ` Igor Munkin 2020-04-23 23:27 ` Igor Munkin 2020-04-28 23:19 ` Vladislav Shpilevoy 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 9/10] Disabled test/luajit-tap in luacheckrc sergeyb 2020-04-24 10:16 ` Igor Munkin 2020-04-29 14:25 ` Sergey Bronnikov 2020-04-21 14:00 ` [Tarantool-patches] [PATCH v4 10/10] luajit: Fix warnings spotted by luacheck sergeyb 2020-04-21 19:33 ` Igor Munkin [this message] 2020-04-22 10:14 ` Sergey Bronnikov 2020-04-23 6:24 ` Sergey Bronnikov 2020-04-23 10:03 ` Igor Munkin 2020-04-23 10:30 ` Sergey Bronnikov
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=20200421193301.GD8314@tarantool.org \ --to=imun@tarantool.org \ --cc=o.piskunov@tarantool.org \ --cc=sergeyb@tarantool.org \ --cc=tarantool-patches@dev.tarantool.org \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v4 10/10] luajit: Fix warnings spotted by luacheck' \ /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