From 0c1ffedd3f0b55d1a525371817445ea3e2bf79b7 Mon Sep 17 00:00:00 2001 From: apio Date: Tue, 8 Nov 2022 19:07:16 +0100 Subject: [PATCH] Add a script to run clang-format on all source files --- tools/run-clang-format.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tools/run-clang-format.sh diff --git a/tools/run-clang-format.sh b/tools/run-clang-format.sh new file mode 100755 index 00000000..4e88d1ec --- /dev/null +++ b/tools/run-clang-format.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e +source $(dirname $0)/env.sh + +cd $LUNA_ROOT + +SOURCES=($(find kernel/src -type f | grep "\.c") $(find kernel/include -type f)) +SOURCES+=($(find libs/libc/src -type f | grep "\.c") $(find libs/libc/include -type f)) +SOURCES+=($(find apps/src -type f)) + +for f in ${SOURCES[@]} +do + clang-format $f -i +done \ No newline at end of file