From 94db7760e2e426f80e02993a6684ee9a708f9ae5 Mon Sep 17 00:00:00 2001 From: Lucas Peter Date: Wed, 5 Mar 2025 15:23:04 +0100 Subject: [PATCH] Update (working) --- format_code.sh | 149 ++++++++++++++++++++++++++++++++++++------------ install_hook.sh | 29 +++++++--- 2 files changed, 135 insertions(+), 43 deletions(-) diff --git a/format_code.sh b/format_code.sh index a2605ce..d833283 100644 --- a/format_code.sh +++ b/format_code.sh @@ -1,54 +1,131 @@ #!/bin/bash +set -eo pipefail # Configuration ROOT_DIR=$(git rev-parse --show-toplevel) -CONFIG_FILE="$ROOT_DIR/.tools/.clang-format" +CLANG_FORMAT_BIN="${ROOT_DIR}/.tools/clang-format" +CLANG_CONFIG="${ROOT_DIR}/.tools/.clang-format" TARGET_DIRS=("Source" "Private" "Public" "Classes") FILE_EXTS=("*.h" "*.cpp" "*.hpp" "*.c") + +# Options DRY_RUN=false VERBOSE=false +CHECK_MODIFIED=false + +# Help text +show_help() { + cat < "$TARGET_HOOK" <