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 87B966C7D3; Fri, 5 Feb 2021 01:53:08 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 87B966C7D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1612479188; bh=VDrOKk2nsGnPET20aQAzTAJRhbAYJYx1GWDenEpA1fg=; h=To:Cc:References:In-Reply-To:Date:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=C8RkA1aQ/rnGR+EHUf9sfFGy3YlxKpI6J5DIM0mvuTlCiquxE61N4/yXneKEIPVKn /vBpzlpac6eoYAh/zG63ihoiv1XrKwRyvs+XsOMOI08rdTeR5sJSKScXCgEbsoBrfl km7UF5Miy7DZUjMheU9rc3JonhGYaYGTxiT2KbUI= Received: from smtp30.i.mail.ru (smtp30.i.mail.ru [94.100.177.90]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 0BDE56C7D3 for ; Fri, 5 Feb 2021 01:53:07 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 0BDE56C7D3 Received: by smtp30.i.mail.ru with esmtpa (envelope-from ) id 1l7nUk-00016F-SB; Fri, 05 Feb 2021 01:53:03 +0300 To: "'Igor Munkin'" , "'Sergey Kaplun'" Cc: References: <7057011c43d41adab30dbd13621570418064d38d.1612291495.git.imun@tarantool.org> In-Reply-To: <7057011c43d41adab30dbd13621570418064d38d.1612291495.git.imun@tarantool.org> Date: Fri, 5 Feb 2021 01:52:57 +0300 Message-ID: <11ba01d6fb48$7b329d20$7197d760$@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJPfenCWrjRxS0krGRZARdqgOlJ3gIFa9YqqUdpPQA= Content-Language: ru X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD953AC099BC0052A9CD238BCF93DF23716D1711D0DDC4F5AC2182A05F538085040E12E965A1FACA49EAB7175B5D44D79C8F4B16BF2D0733C904984893F6DEAA677 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE700B5EAEB6F2DE1BDEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F790063727BBC20C3D5F36038638F802B75D45FF5571747095F342E8C7A0BC55FA0FE5FC0302E880A7698C90D80C61C9C1A3B0FEE6B3EF724A5A0AD9389733CBF5DBD5E913377AFFFEAFD269176DF2183F8FC7C0A29E2F051442AF778941B15DA834481FCF19DD082D7633A0EF3E4896CB9E6436389733CBF5DBD5E9D5E8D9A59859A8B652D31B9D28593E51CC7F00164DA146DA6F5DAA56C3B73B237318B6A418E8EAB8D32BA5DBAC0009BE9E8FC8737B5C2249CFC42FA33B25498B76E601842F6C81A12EF20D2F80756B5F7E9C4E3C761E06A776E601842F6C81A127C277FBC8AE2E8B6F8235414F7F731CD81D268191BDAD3D698AB9A7B718F8C442539A7722CA490C13377AFFFEAFD26923F8577A6DFFEA7CE1AEB6AF2DA18B6293EC92FD9297F6715571747095F342E857739F23D657EF2BD5E8D9A59859A8B6AC294AFEFA671E80089D37D7C0E48F6C5571747095F342E857739F23D657EF2B6825BDBE14D8E7024847893F9AA87235E5BFE6E7EFDEDCD789D4C264860C145E X-C1DE0DAB: 0D63561A33F958A538BFE527CFC74FC853D62BFF14437F8438E00241E4E95EC2D59269BC5F550898D99A6476B3ADF6B47008B74DF8BB9EF7333BD3B22AA88B938A852937E12ACA75448CF9D3A7B2C848410CA545F18667F91A7EA1CDA0B5A7A0 X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D34697E0FA301E28215F33B4684A429D812AF35EE8C1F4890B6EA9B68E5E02BD9C64F64CE79366EB6DC1D7E09C32AA3244CD7C662FA2A30ED205261A762C28A6656795D98D676DD64D0FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2bioj9Cv0SAP7uQXBl053tYQhXA== X-Mailru-Sender: 6CA451E36783D721CBEA96CEA26D325D2237FADDBA71A8C91FCBCE5A6C721C30B7CBEF92542CD7C82F97C478340294DCC77752E0C033A69E0F0C7111264B8915FF1320A92A5534336C18EFA0BB12DBB0 X-Mras: Ok Subject: Re: [Tarantool-patches] [PATCH luajit 5/5] test: run luacheck static analysis via CMake 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: Timur Safin via Tarantool-patches Reply-To: Timur Safin Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" LGTM as obvious! : From: Igor Munkin : Subject: [PATCH luajit 5/5] test: run luacheck static analysis via = CMake :=20 : This patch introduces a separate target to run luacheck against all = Lua : chunks within LuaJIT repository except those explicitly ignored in : .luacheckrc. There is also a single additional change over the = 'luajit' : std defaults: to suppress all false positives related to : namespace introduced in 5a61e1ab54b5c66bfebd836db1ac47996611e065 = ('misc: : add C and Lua API for platform metrics'), this name is added to : list. :=20 : All Lua sources originally inherited from LuaJIT vanilla repository = are : ignored, to leave them coherent with the upstream. :=20 : The new target is a dependency for the root target. :=20 : Part of tarantool/tarantool#4862 : Part of tarantool/tarantool#5470 :=20 : Signed-off-by: Igor Munkin : --- : .gitignore | 1 + : .luacheckrc | 11 +++++++++++ : test/CMakeLists.txt | 31 +++++++++++++++++++++++++++++++ : 3 files changed, 43 insertions(+) : create mode 100644 .luacheckrc :=20 : diff --git a/.gitignore b/.gitignore : index 35d2580..7902547 100644 : --- a/.gitignore : +++ b/.gitignore : @@ -17,6 +17,7 @@ Makefile : cmake_install.cmake : compile_commands.json : install_manifest.txt : +luacheck.ok : luajit-parse-memprof : luajit.pc : tests.ok : diff --git a/.luacheckrc b/.luacheckrc : new file mode 100644 : index 0000000..0a5d001 : --- /dev/null : +++ b/.luacheckrc : @@ -0,0 +1,11 @@ : +-- Use the default LuaJIT globals. : +std =3D 'luajit' : +-- This fork also introduces a new global for misc API namespace. : +read_globals =3D { 'misc' } : + : +-- These files are inherited from the vanilla LuaJIT and need to : +-- be coherent with the upstream. : +exclude_files =3D { : + 'dynasm/', : + 'src/', : +} : diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt : index f05dd90..c89efc2 100644 : --- a/test/CMakeLists.txt : +++ b/test/CMakeLists.txt : @@ -3,6 +3,36 @@ : # See the rationale in the root CMakeLists.txt. : cmake_minimum_required(VERSION 3.1 FATAL_ERROR) :=20 : +find_program(LUACHECK luacheck) : +if(LUACHECK) : + set(LUACHECK_RC ${PROJECT_SOURCE_DIR}/.luacheckrc) : + set(LUACHECK_OK ${CMAKE_CURRENT_BINARY_DIR}/luacheck.ok) : + file(GLOB_RECURSE LUACHECK_DEPS ${PROJECT_SOURCE_DIR}/*.lua) : + add_custom_command( : + COMMENT "Running luacheck static analysis" : + OUTPUT ${LUACHECK_OK} : + DEPENDS ${LUACHECK} ${LUACHECK_RC} ${LUACHECK_DEPS} : + COMMAND : + ${LUACHECK} ${PROJECT_SOURCE_DIR} : + --codes : + --config ${LUACHECK_RC} : + && touch ${LUACHECK_OK} : + # XXX: Filenames in .luacheckrc are considered relative to : + # the working directory, hence luacheck should be run in the : + # project root directory. : + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} : + ) : +else() : + add_custom_command( : + COMMENT "`luacheck' is not found, so ${PROJECT_NAME}-luacheck = target is : dummy" : + OUTPUT luacheck.ok : + COMMAND touch luacheck.ok : + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} : + ) : +endif() : + : +add_custom_target(${PROJECT_NAME}-luacheck DEPENDS luacheck.ok) : + : add_subdirectory(tarantool-tests) :=20 : add_custom_target(${PROJECT_NAME}-test DEPENDS : @@ -24,5 +54,6 @@ if(LUAJIT_USE_TEST) :=20 : add_custom_target(test DEPENDS : ${PROJECT_NAME}-test : + ${PROJECT_NAME}-luacheck : ) : endif() : -- : 2.25.0