From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng2.m.smailru.net (smtpng2.m.smailru.net [94.100.179.3]) (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 6D6CF45C30B for ; Mon, 7 Dec 2020 10:51:25 +0300 (MSK) From: sergeyb@tarantool.org Date: Mon, 7 Dec 2020 10:46:55 +0300 Message-Id: <74c1afcd0a5fdd305ecc5b9d149d30b62a996886.1607326642.git.sergeyb@tarantool.org> In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 5/6] cmake: add integration with flake8 List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tarantool-patches@dev.tarantool.org, lvasiliev@tarantool.org Cc: alexander.turenko@tarantool.org From: Sergey Bronnikov introduced two new targets: - separate target to run flake8 - separate target to run all static analyzers (currently luacheck and flake8) --- CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa6818f8e..8dae93e6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,6 +26,7 @@ find_program(GIT git) find_program(LD ld) find_program(CTAGS ctags) find_program(LUACHECK luacheck ENV PATH) +find_program(FLAKE8 flake8 ENV PATH) # Define PACKAGE macro in tarantool/config.h set(PACKAGE "Tarantool" CACHE STRING "Package name.") @@ -164,6 +165,23 @@ add_custom_command(TARGET luacheck COMMENT "Perform static analysis of Lua code" ) +# +# Enable 'make flake8' target. +# + +add_custom_target(flake8) +add_custom_command(TARGET flake8 + COMMAND ${FLAKE8} --config "${PROJECT_SOURCE_DIR}/.flake8" "${PROJECT_SOURCE_DIR}/test" + COMMENT "Perform static analysis of Python code" +) + +# +# Enable 'make check' target. +# + +add_custom_target(check) +add_dependencies(check luacheck flake8) + if (WITH_JEPSEN) ExternalProject_Add( jepsen-tests -- 2.25.1