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 63E64559A06; Wed, 2 Aug 2023 11:56:54 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 63E64559A06 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1690966614; bh=C5oO0Y6xINVwM4wrxf3KGBXp1EzhjH0invXCYPFl7Nw=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=BtUn6ZarZoRWtm4HKnmIfpitX7q07nd7UEylmXY1oxC9uVr7kUOwtDjkazB7NhT+H hCTRfXfcoqdFTlZ/QiZWBGO4xsCpJVVfoSf0/RSDozski/pr8g50YzdFFF3+2jqIdq hhcDRSwQlqiNaompucpNgz23rHNqDBlRawCdILpg= Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (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 E296F559A06 for ; Wed, 2 Aug 2023 11:55:44 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org E296F559A06 Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-99bd1d0cf2fso995038666b.3 for ; Wed, 02 Aug 2023 01:55:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690966544; x=1691571344; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=384H5eVCawH8ejhXgeRs5DASx3+qSC56YHjOoNIj+k4=; b=B5WsWRXTTJ8C0RO/YdH/MbMdRS+Ot7v953OiQy61ivb0VFQdTNSKvJfdqG7+3Rm8SZ tsZWO6q4vULojzRTGooZAQ+1dF2dGm6yWv5qe5zf1UZdn4ozGCg7El5XSIlh1m9ebalM UDvOOpx1H843ggKDOsFV8mUN2pPzp+vqsF794ljkehkhGdzp2Uovy21qpKP068O9j8i0 PQt+3RGOCJsbEkFUpFzjEqkf8ejW0orOPNuYvfQKxB3i+bCUjohEWyDw2KJ8wmObFIxS OX/nv0zTN+tH3OwvGdY9XpJIOrgxUJ8t5YcUXXFg0NdLKO3Fv2dfTjhxCQ+8joluddXy iCIA== X-Gm-Message-State: ABy/qLY84PCtx8wLtunzYR9/GePOEVON65Jq5bgeHDDJzGPgnKqGihk9 U9niiktLQ6bydEpxWxifGdjUK72z36w= X-Google-Smtp-Source: APBJJlEFKqO5JgLvBHtWuPx556OLht61IgueuehV99k2Ik5mPp8KDmGa70V8sOINosyNXsuq3ZuAkg== X-Received: by 2002:a17:907:2cf4:b0:993:f15f:efb7 with SMTP id hz20-20020a1709072cf400b00993f15fefb7mr4517293ejc.8.1690966543967; Wed, 02 Aug 2023 01:55:43 -0700 (PDT) Received: from pony.. ([185.6.247.97]) by smtp.gmail.com with ESMTPSA id jt9-20020a170906dfc900b0098dfec235ccsm8780125ejc.47.2023.08.02.01.55.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Aug 2023 01:55:43 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, Sergey Kaplun , max.kokryashkin@gmail.com Date: Wed, 2 Aug 2023 11:52:22 +0300 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 3/5][v3] cmake: introduce new targets 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" From: Sergey Bronnikov In Tarantool we use our own fork of checkpatch [1] with additional check types. It's logical to use it in LuaJIT development. However, we don't need to enable all checks [2] implemented in checkpatch, therefore a number of checks are disabled. Patch introduces two new CMake targets: "LuaJIT-checkpatch", that checks patches on top of the master branch using script checkpatch.pl, and target "check", that combines LuaJIT-luacheck and LuaJIT-checkpatch. By default CMake looking for checkpatch.pl in a directory "checkpatch" in LuaJIT repository root directory and in a directories specified in PATH. 1. https://github.com/tarantool/checkpatch 2. https://github.com/tarantool/checkpatch/blob/master/doc/checkpatch.rst --- test/CMakeLists.txt | 51 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 47296a22..5ec0bed6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -42,6 +42,56 @@ else() ) endif() +find_program(CHECKPATCH checkpatch.pl + HINTS ${PROJECT_SOURCE_DIR}/checkpatch) +add_custom_target(${PROJECT_NAME}-checkpatch) +set(MASTER_BRANCH "tarantool/master") +if(CHECKPATCH) + add_custom_command(TARGET ${PROJECT_NAME}-checkpatch + COMMENT "Running checkpatch" + COMMAND + ${CHECKPATCH} + # Description of supported checks in + # https://github.com/tarantool/checkpatch/blob/master/doc/checkpatch.rst + --codespell + --color=always + --git ${MASTER_BRANCH}..HEAD + --show-types + --ignore BAD_SIGN_OFF + --ignore BLOCK_COMMENT_STYLE + --ignore CODE_INDENT + --ignore COMMIT_LOG_LONG_LINE + # Requires at least two lines in commit message and this + # is annoying. + --ignore COMMIT_MESSAGE + --ignore CONSTANT_COMPARISON + --ignore FUNCTION_NAME_NO_NEWLINE + --ignore GIT_COMMIT_ID + --ignore INCLUDE_GUARD + --ignore LOGICAL_CONTINUATIONS + --ignore LONG_LINE + --ignore NO_CHANGELOG + --ignore NO_DOC + --ignore NO_TEST + --ignore PREFER_DEFINED_ATTRIBUTE_MACRO + --ignore SPACING + --ignore SUSPECT_CODE_INDENT + --ignore TABSTOP + --ignore TRAILING_STATEMENTS + --ignore UNCOMMENTED_DEFINITION + --ignore UNSAFE_FUNCTION + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) +else() + add_custom_command(TARGET ${PROJECT_NAME}-checkpatch + COMMENT "`checkpatch.pl' is not found, so ${PROJECT_NAME}-checkpatch target is dummy" + ) +endif() + +add_custom_target(check + DEPENDS ${PROJECT_NAME}-checkpatch ${PROJECT_NAME}-luacheck +) + set(LUAJIT_TEST_COMMAND "${LUAJIT_TEST_BINARY} -e dofile[[${LUAJIT_TEST_INIT}]]") separate_arguments(LUAJIT_TEST_COMMAND) @@ -75,5 +125,6 @@ if(LUAJIT_USE_TEST) add_custom_target(test DEPENDS ${PROJECT_NAME}-test ${PROJECT_NAME}-luacheck + ${PROJECT_NAME}-checkpatch ) endif() -- 2.34.1