From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id ECC61F1F7C3; Tue, 11 Feb 2025 09:57:04 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org ECC61F1F7C3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1739257025; bh=KXO6g6xASe2uONIi76zX6uov2lyrUXWwo6Is9pqOxKA=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=vyFuXS9dZe7IlEQPdqG7dZU9AQcIybjsQSvmIvhqWwD9jw6eB+EI8BM0OwgeNHlqe 7ZCRIuVbVuuP6yjcLCGtl2RcGVRGj3+eKb7x/Q0wK2mNoXkeqFXvN5BAQCjSGSxTRE MttdOJ8G36k05OFN8ubPk0ZYBHae08nr2rbDeZjk= Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id D82736FA61 for ; Tue, 11 Feb 2025 09:57:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org D82736FA61 Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-308edbc368cso18313551fa.1 for ; Mon, 10 Feb 2025 22:57:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739257022; x=1739861822; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CwvYGh2qfL6XK+kTbyPlyCGF/MQTNlVIUOeZGTLU/HQ=; b=JcZ4ABNsxCUvALE9UvQv6jRnrz8IhiLq0+/Zx6jI0BFSyPkV1xJrrsBmC6N1tgh6sJ 0VqgruWJvvMofeb1RSXEHP50FgbeyO/dF0iYlGx2SpYR1SSl6c2OWH1iXl9tSY+cCu5O udJkXAdiluHMnaJT/R2wfh4Nx5nJoIyo9krNhYm1NEzJ36MoMIRCL1hAyml1q7/HSAaS cU3wD1Yigpg8r3nwMblWgJ79UCzq8VUzPL7oiuwEEcYVC94Sj6+RCjqNrhgIGKRcpYY9 cbfVmvrtS0QQ5IwsPg7YbthOm9Xm4h27UsPrRKL7U4RbR3CLYsT/wnT8zgU+mJUyNEkK FDAw== X-Gm-Message-State: AOJu0YwY60Z4SQrzqjDRPZmTMS0+o5z2/GFSsqdKzzva2/j6CgNeHfKR 3kMW/mrH5b6QsGPubOQEwpkYnmkFXpvUN9nvTMSQKHQPTgV6ywpktyKiwtGt X-Gm-Gg: ASbGnctK/MZE57lW/uzMu3a476gRU+SpQJ93tSB8XnHcew8qysfg4m+TkQDFcYw3gwW HqEcGdHQovHbOKvJoB5IXrijIv0iCE/QZ+bqqi83qX+aG7T2xMn68iQFD5VQnzPbeX92TKUjuMU stcdpukAh9gPLEXwpTO//GSXESOmwnCQMYG7ndjyE0VrzQqQ1V/D4SSwkJomaoBKv49D1BLJc6d LbOL4KuDWNdZlnU90GRa4HFkZuKIgLwKnk8sRDIF6bmS+99tWRBj/wgPsL2+QrAU0e33GnXwen+ Gvb71Gkc X-Google-Smtp-Source: AGHT+IHjSl+i/9Wm6CUv866aPHAb85H6SQE/Df/tWTmpUNbAZiqi/Q1gtvW4dgeIHq4QX/6+lXMAhQ== X-Received: by 2002:a2e:be8c:0:b0:2ff:a928:a23e with SMTP id 38308e7fff4ca-308f83d0c36mr9341971fa.25.1739257020926; Mon, 10 Feb 2025 22:57:00 -0800 (PST) Received: from localhost ([79.164.223.111]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-308f05221c5sm4226701fa.58.2025.02.10.22.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Feb 2025 22:56:59 -0800 (PST) X-Google-Original-From: Sergey Bronnikov To: tarantool-patches@dev.tarantool.org, Sergey Kaplun Date: Tue, 11 Feb 2025 09:55:20 +0300 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH luajit] test: limit code and comment max length by 80 X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Sergey Bronnikov via Tarantool-patches Reply-To: Sergey Bronnikov Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" The patch sets a max length with 80 symbols and fixes tests exceeding this length. --- Branch: https://github.com/tarantool/luajit/tree/ligurio/gh-xxxx-set-max-length Luacheck configuration file: https://luacheck.readthedocs.io/en/stable/config.html .luacheckrc | 5 +++++ test/tarantool-tests/fix-argv-handling.test.lua | 4 ++++ .../gh-3196-incorrect-string-length.test.lua | 3 +++ test/tarantool-tests/gh-6163-min-max.test.lua | 4 ++++ .../lj-366-strtab-correct-size.test.lua | 10 ++++++++-- .../lj-494-table-chain-infinite-loop.test.lua | 3 ++- test/tarantool-tests/lj-688-snap-ir-rename.test.lua | 2 ++ test/tarantool-tests/lj-819-fix-missing-uclo.test.lua | 6 ++++-- .../lj-918-fma-numerical-accuracy-jit.test.lua | 4 ++++ .../lj-918-fma-numerical-accuracy.test.lua | 4 ++++ test/tarantool-tests/or-144-gc64-asmref-l.test.lua | 4 ++++ 11 files changed, 44 insertions(+), 5 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index f2573e42..8047677c 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -3,6 +3,11 @@ std = 'luajit' -- This fork also introduces a new global for misc API namespace. read_globals = { 'misc' } +max_line_length = 80 +max_code_line_length = 80 +max_string_line_length = 80 +max_comment_line_length = 80 + -- The `_TARANTOOL` global is often used for skip condition -- checks in tests. files['test/tarantool-tests/'] = { diff --git a/test/tarantool-tests/fix-argv-handling.test.lua b/test/tarantool-tests/fix-argv-handling.test.lua index 84b626c3..5f147197 100644 --- a/test/tarantool-tests/fix-argv-handling.test.lua +++ b/test/tarantool-tests/fix-argv-handling.test.lua @@ -10,7 +10,11 @@ test:plan(1) -- to a single empty string if it is empty [1], so the issue is -- not reproducible on new kernels. -- +-- luacheck: push no max comment line length +-- -- [1]: https://lore.kernel.org/all/20220201000947.2453721-1-keescook@chromium.org/ +-- +-- luacheck: pop local utils = require('utils') local execlib = require('execlib') diff --git a/test/tarantool-tests/gh-3196-incorrect-string-length.test.lua b/test/tarantool-tests/gh-3196-incorrect-string-length.test.lua index b82029f6..79521608 100644 --- a/test/tarantool-tests/gh-3196-incorrect-string-length.test.lua +++ b/test/tarantool-tests/gh-3196-incorrect-string-length.test.lua @@ -6,10 +6,13 @@ test:plan(2) -- -- gh-3196: incorrect string length if Lua hash returns 0 -- +-- luacheck: push no max code line length +-- local h = "\x1F\x93\xE2\x1C\xCA\xDE\x28\x08\x26\x01\xED\x0A\x2F\xE4\x21\x02\x97\x77\xD9\x3E" test:is(h:len(), 20) h = "\x0F\x93\xE2\x1C\xCA\xDE\x28\x08\x26\x01\xED\x0A\x2F\xE4\x21\x02\x97\x77\xD9\x3E" test:is(h:len(), 20) +-- luacheck: pop test:done(true) diff --git a/test/tarantool-tests/gh-6163-min-max.test.lua b/test/tarantool-tests/gh-6163-min-max.test.lua index e3efd1a4..ca6c2a7f 100644 --- a/test/tarantool-tests/gh-6163-min-max.test.lua +++ b/test/tarantool-tests/gh-6163-min-max.test.lua @@ -69,9 +69,13 @@ jit.opt.start('hotloop=1') -- pair is emitted, and the result is `NaN`, which is inconsistent with -- the result of the non-optimized mcode. -- +-- luacheck: push no max comment line length +-- -- [1]: https://developer.arm.com/documentation/dui0801/g/A64-Floating-point-Instructions/FCMP -- [2]: https://developer.arm.com/documentation/100069/0608/A64-Floating-point-Instructions/FCSEL -- [3]: https://developer.arm.com/documentation/dui0068/b/ARM-Instruction-Reference/Conditional-execution +-- +-- luacheck: pop local result = {} for k = 1, 4 do diff --git a/test/tarantool-tests/lj-366-strtab-correct-size.test.lua b/test/tarantool-tests/lj-366-strtab-correct-size.test.lua index a20339e5..b46ace49 100644 --- a/test/tarantool-tests/lj-366-strtab-correct-size.test.lua +++ b/test/tarantool-tests/lj-366-strtab-correct-size.test.lua @@ -22,11 +22,15 @@ local utils = require('utils') -- -- $ readelf --symbols xxx.obj -- +-- luacheck: push no max comment line length +-- -- Symbol table '.symtab' contains 2 entries: -- Num: Value Size Type Bind Vis Ndx Name -- 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND -- 1: 0000000000000000 66 OBJECT GLOBAL DEFAULT 4 luaJIT_BC_lango_team -- +-- luacheck: pop +-- -- and to display the information contained in the file's section -- headers, if it has any. For our purposes, we are interested in -- .symtab section, so other sections are snipped in the output: @@ -143,7 +147,8 @@ end -- and symtab sections. local function read_elf(elf_content) local ELFobj_type = ffi.typeof(is64 and 'ELF64obj *' or 'ELF32obj *') - local ELFsectheader_type = ffi.typeof(is64 and 'ELF64sectheader *' or 'ELF32sectheader *') + local ELFsectheader_type = ffi.typeof(is64 and 'ELF64sectheader *' or + 'ELF32sectheader *') local elf = ffi.cast(ELFobj_type, elf_content) local symtab_hdr, strtab_hdr -- Iterate by section headers. @@ -178,7 +183,8 @@ assert(sym_cnt ~= 0, 'number of symbols is zero') test:is(strtab_size, EXPECTED_STRTAB_SIZE, 'check .strtab size') test:is(strtab_offset, EXPECTED_STRTAB_OFFSET, 'check .strtab offset') -local strtab_str = string.sub(elf_content, strtab_offset, strtab_offset + strtab_size) +local strtab_str = string.sub(elf_content, strtab_offset, + strtab_offset + strtab_size) local strtab_p = ffi.cast('char *', strtab_str) local sym_is_found = false diff --git a/test/tarantool-tests/lj-494-table-chain-infinite-loop.test.lua b/test/tarantool-tests/lj-494-table-chain-infinite-loop.test.lua index 3dd17e7a..1c1d7128 100644 --- a/test/tarantool-tests/lj-494-table-chain-infinite-loop.test.lua +++ b/test/tarantool-tests/lj-494-table-chain-infinite-loop.test.lua @@ -172,6 +172,7 @@ collectgarbage() for c, v in pairs(victims) do str_hash(v)[0] = orig_hash[c] end -test:ok(true, "table keys collisions are resolved properly (no assertions failed)") +test:ok(true, + "table keys collisions are resolved properly (no assertions failed)") test:done(true) diff --git a/test/tarantool-tests/lj-688-snap-ir-rename.test.lua b/test/tarantool-tests/lj-688-snap-ir-rename.test.lua index 807e0811..5b458cd0 100644 --- a/test/tarantool-tests/lj-688-snap-ir-rename.test.lua +++ b/test/tarantool-tests/lj-688-snap-ir-rename.test.lua @@ -41,7 +41,9 @@ jit.opt.start('hotloop=1') -- platform-agnostic, there is no real necessity to test it -- against ARM/ARM64 separately. -- +-- luacheck: push no max comment line length -- See also https://drive.google.com/file/d/1iYkFx3F0DOtB9o9ykWfCEm-OdlJNCCL0/view?usp=share_link +-- luacheck: pop local vals = {-0.1, 0.1, -0.1, 0.1} diff --git a/test/tarantool-tests/lj-819-fix-missing-uclo.test.lua b/test/tarantool-tests/lj-819-fix-missing-uclo.test.lua index e2352c92..43a65eb8 100644 --- a/test/tarantool-tests/lj-819-fix-missing-uclo.test.lua +++ b/test/tarantool-tests/lj-819-fix-missing-uclo.test.lua @@ -100,7 +100,8 @@ local f = missing_uclo() local res = f() -- Without a patch we don't get here a function, because upvalue isn't closed -- as desirable. -test:ok(type(res) == 'function', 'virtual machine consistency: type of returned value is correct') +test:ok(type(res) == 'function', + 'virtual machine consistency: type of returned value is correct') -- Make JIT compiler aggressive. jit.opt.start('hotloop=1') @@ -110,6 +111,7 @@ f() f = missing_uclo() local _ _, res = pcall(f) -test:ok(type(res) == 'function', 'consistency on compilation: type of returned value is correct') +test:ok(type(res) == 'function', + 'consistency on compilation: type of returned value is correct') test:done(true) diff --git a/test/tarantool-tests/lj-918-fma-numerical-accuracy-jit.test.lua b/test/tarantool-tests/lj-918-fma-numerical-accuracy-jit.test.lua index 8b16d4c3..43c1a4a9 100644 --- a/test/tarantool-tests/lj-918-fma-numerical-accuracy-jit.test.lua +++ b/test/tarantool-tests/lj-918-fma-numerical-accuracy-jit.test.lua @@ -22,9 +22,13 @@ local _2pow52 = 2 ^ 52 -- double rounding. The numbers from the original issue are good -- enough. -- +-- luacheck: push no max comment line length +-- -- [1]:https://developer.arm.com/documentation/dui0801/g/A64-Floating-point-Instructions/FMSUB -- [2]:https://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_operation -- +-- luacheck: pop +-- -- IEEE754 components to double: -- sign * (2 ^ (exp - 1023)) * (mantissa / _2pow52 + normal). local a = 1 * (2 ^ (1083 - 1023)) * (4080546448249347 / _2pow52 + 1) diff --git a/test/tarantool-tests/lj-918-fma-numerical-accuracy.test.lua b/test/tarantool-tests/lj-918-fma-numerical-accuracy.test.lua index 25b59707..2472f05a 100644 --- a/test/tarantool-tests/lj-918-fma-numerical-accuracy.test.lua +++ b/test/tarantool-tests/lj-918-fma-numerical-accuracy.test.lua @@ -20,9 +20,13 @@ local _2pow52 = 2 ^ 52 -- double rounding. The numbers from the original issue are good -- enough. -- +-- luacheck: push no max comment line length +-- -- [1]:https://developer.arm.com/documentation/dui0801/g/A64-Floating-point-Instructions/FMSUB -- [2]:https://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_operation -- +-- luacheck: pop +-- -- IEEE754 components to double: -- sign * (2 ^ (exp - 1023)) * (mantissa / _2pow52 + normal). local a = 1 * (2 ^ (1083 - 1023)) * (4080546448249347 / _2pow52 + 1) diff --git a/test/tarantool-tests/or-144-gc64-asmref-l.test.lua b/test/tarantool-tests/or-144-gc64-asmref-l.test.lua index 18c6efb2..cbc13278 100644 --- a/test/tarantool-tests/or-144-gc64-asmref-l.test.lua +++ b/test/tarantool-tests/or-144-gc64-asmref-l.test.lua @@ -5,11 +5,15 @@ local test = tap.test('or-144-gc64-asmref-l'):skipcond({ test:plan(1) +-- luacheck: push no max comment line length +-- -- Test file to demonstrate LuaJIT `IR_LREF` assembling incorrect -- behaviour. -- See also: -- * https://github.com/openresty/lua-resty-core/issues/144. -- * https://www.freelists.org/post/luajit/Consistent-SEGV-on-x64-with-the-latest-LuaJIT-v21-GC64-mode. +-- +-- luacheck: pop jit.opt.start('hotloop=1') -- 2.34.1