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 536A2516A7E; Mon, 17 Jul 2023 16:38:11 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 536A2516A7E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1689601091; bh=bgzj3DZnuJ7QM44W7uZ5wMPjFh9ZGFXEMsIZi7oiDG4=; 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=Q6Z9EMMPKA/FLHC8ThpS7hKlR6P3J6pjSrxUZbFtmYaFfXA2yJf8vuIqiT6LYD+hd EDgIyQW9YltSvUVlQXuISt64N6Yh4IpA+EWAHpZ7HM1ELHOOHfchzXLZZwfOfrMHIp 4LRDl9zt0d4pGLFvJxleJhODS6CdCcIvod6ztthQ= Received: from mail-lf1-f52.google.com (mail-lf1-f52.google.com [209.85.167.52]) (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 C1C4E516FC0 for ; Mon, 17 Jul 2023 16:36:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org C1C4E516FC0 Received: by mail-lf1-f52.google.com with SMTP id 2adb3069b0e04-4fb7769f15aso7145273e87.0 for ; Mon, 17 Jul 2023 06:36:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689601002; x=1692193002; 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=H784DgGWEdprVj/NYEe+5V10eSw10GAZSt4PLdvpV/w=; b=Yv6mDjJ+xHAXZzl/iAiUhP6uC4sasTMY5giDOsaAfPISbWa7oHbJHaAmjZX3CEsEB0 z8zeoCE3yWCKHlniaUOG88Un+a5uf8NXbeHEapM2hbM6OnD1wAZRc5Nq/niEklFzZult 6b72WScFF1kmIpIbMqk9IkOnkHfcIYluFLIacs2pbo+PBg79qDtmV/tWhQ1bvEm4bspv tIYhr67ikzdyAUyEZPHZ783oQEL0OaHkkSJ+HqqyYw8ZdC17yagJhUvqBfchMi4sllsc vnrOf29HTMGtYkJ3Jh+DWlBum6iPj1/Ozu8f8VpC2vfdgsa3wE2OA05xfC531gjlO7SQ xZMw== X-Gm-Message-State: ABy/qLb8SL/eYozDO611gTZf7tUIeu1kW89tEpa/ZL2hsa5RxGTXIjvf MEvrczT0OKb5lFqFGFvGEJUUXCzgyoc= X-Google-Smtp-Source: APBJJlEFXq5xkHwwBYp+s0DxnLfQUOLSqfJ5fw4jp5HOuZ49FUTrjr+vPeGfS1yZp1hRRUzBcJh+KA== X-Received: by 2002:a19:4f10:0:b0:4f6:2e4e:e425 with SMTP id d16-20020a194f10000000b004f62e4ee425mr7399318lfb.50.1689601001968; Mon, 17 Jul 2023 06:36:41 -0700 (PDT) Received: from pony.. ([185.6.247.97]) by smtp.gmail.com with ESMTPSA id a19-20020a50ff13000000b0051bed498851sm9989800edu.54.2023.07.17.06.36.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 06:36:41 -0700 (PDT) To: tarantool-patches@dev.tarantool.org, Sergey Kaplun , max.kokryashkin@gmail.com Date: Mon, 17 Jul 2023 16:34:36 +0300 Message-Id: <1c8a5c13c50a2561ebe5d3f82749df644fe2a352.1689600525.git.sergeyb@tarantool.org> 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/4][v2] cmake: introduce 'check' and 'LuaJIT-checkpatch' 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 [2] with additional check types. It's logical to use it in a LuaJIT development. We don't need check tags in commit messages like NO_DOC, NO_CHANGELOG, NO_TEST and others, so to be able to customize command-line options Github Action, provided by checkpatch repository [3], was added to the repository. See documentation for used checkpatch in [4]. Patch introduce new CMake targets: LuaJIT-checkpatch, that checks patches on top of master branch using script checkpatch.pl [1], and target check, that combines LuaJIT-luacheck and LuaJIT-checkpatch. 1. https://docs.kernel.org/dev-tools/checkpatch.html 2. https://github.com/tarantool/checkpatch 3. https://github.com/tarantool/checkpatch/blob/master/.github/actions/checkpatch/action.yml 4. https://github.com/tarantool/checkpatch/blob/master/doc/checkpatch.rst --- test/CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 47296a22..ccbad035 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -42,6 +42,39 @@ else() ) endif() +find_program(CHECKPATCH checkpatch.pl + HINTS ${PROJECT_SOURCE_DIR}/checkpatch) +if(CHECKPATCH) + set(MASTER_BRANCH "tarantool/master") + add_custom_target(${PROJECT_NAME}-checkpatch) + add_custom_command(TARGET ${PROJECT_NAME}-checkpatch + COMMENT "Running checkpatch" + COMMAND + ${CHECKPATCH} + --codespell + --color=always + --git ${MASTER_BRANCH}..HEAD + --ignore COMMIT_LOG_LONG_LINE + # Requires at least two lines in commit message and this + # is annoying. + --ignore COMMIT_MESSAGE + --ignore NO_CHANGELOG + --ignore NO_DOC + --ignore NO_TEST + --show-types + WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} + ) +else() + add_custom_target(${PROJECT_NAME}-checkpatch) + 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) -- 2.34.1