[Tarantool-patches] [PATCH 4/5] gitlab-ci: add code style check

Kirill Yukhin kyukhin at tarantool.org
Fri Oct 30 14:43:51 MSK 2020


Using `make format-check` rule which in turn
invokes CLang formatter v.11

Closes #4297
---
 .gitlab-ci.yml | 7 +++++++
 .travis.mk     | 6 +++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index dc58888..6a4e230 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -179,6 +179,13 @@ luacheck:
   script:
     - ${GITLAB_MAKE} test_debian_docker_luacheck
 
+clang-format:
+  <<: *docker_test_definition
+  stage: static_analysis
+  image: "${CI_REGISTRY}/${CI_PROJECT_PATH}/testing/debian-buster:latest"
+  script:
+    - ${GITLAB_MAKE} test_debian_clang_format
+
 # Tests
 
 out_of_source:
diff --git a/.travis.mk b/.travis.mk
index a44e1b0..c2c4e75 100644
--- a/.travis.mk
+++ b/.travis.mk
@@ -90,7 +90,7 @@ deps_buster_clang_11: deps_debian
 	echo "deb-src http://apt.llvm.org/buster/ llvm-toolchain-buster-11 main" >> /etc/apt/sources.list.d/clang_11.list
 	wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
 	apt-get update
-	apt-get install -y clang-11 llvm-11-dev
+	apt-get install -y clang-11 llvm-11-dev clang-format-11
 
 deps_debian_jepsen: $(BIN_DIR)/clojure $(BIN_DIR)/lein $(BIN_DIR)/terraform
 	apt-get update ${APT_EXTRA_FLAGS} && apt-get install -y -f \
@@ -209,6 +209,10 @@ test_debian_install_luacheck:
 test_debian_luacheck: test_debian_install_luacheck configure_debian
 	make luacheck
 
+test_debian_clang_format:
+	cmake .
+	make format-check
+
 # Out-Of-Source build
 
 build_oos:
-- 
1.8.3.1



More information about the Tarantool-patches mailing list