[Tarantool-patches] [PATCH 5/6] cmake: add integration with flake8
sergeyb at tarantool.org
sergeyb at tarantool.org
Mon Dec 7 10:46:55 MSK 2020
From: Sergey Bronnikov <sergeyb at tarantool.org>
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
More information about the Tarantool-patches
mailing list