@@ -91,6 +91,12 @@ install-valgrind-if-missing: update-apt-cache-if-needed
9191 sudo snap install valgrind --classic; \
9292 )
9393
94+ install-clang-format-if-missing : update-apt-cache-if-needed
95+ @clang-format --version > /dev/null 2>&1 || (\
96+ echo " clang-format not found in the system, install it." ; \
97+ sudo apt install -y clang-format; \
98+ )
99+
94100install-ccm-if-missing :
95101 @ccm list > /dev/null 2>&1 || (\
96102 echo " CCM not found in the system, install it." ; \
@@ -158,9 +164,17 @@ fix-cargo-fmt: install-cargo-if-missing _update-rust-tooling
158164 @echo " Running \" cargo fmt --verbose --all\" in ./scylla-rust-wrapper"
159165 @cd ${CURRENT_DIR} /scylla-rust-wrapper; cargo fmt --verbose --all
160166
161- check : check-cargo check-cargo-clippy check-cargo-fmt
167+ check-clang-format : install-clang-format-if-missing
168+ @echo " Running \" clang-format --dry-run\" on all files in ./src"
169+ @find src -regextype posix-egrep -regex ' .*\.(cpp|hpp|c|h)' -not -path ' src/third_party/*' | xargs clang-format --dry-run
170+
171+ fix-clang-format : install-clang-format-if-missing
172+ @echo " Running \" clang-format -i\" on all files in ./src"
173+ @find src -regextype posix-egrep -regex ' .*\.(cpp|hpp|c|h)' -not -path ' src/third_party/*' | xargs clang-format -i
174+
175+ check : check-clang-format check-cargo check-cargo-clippy check-cargo-fmt
162176
163- fix : fix-cargo fix-cargo-clippy fix-cargo-fmt
177+ fix : fix-clang-format fix- cargo fix-cargo-clippy fix-cargo-fmt
164178
165179prepare-integration-test : update-apt-cache-if-needed install-valgrind-if-missing install-cargo-if-missing _update-rust-tooling
166180 @sudo sh -c " echo 2097152 >> /proc/sys/fs/aio-max-nr"
0 commit comments