From 9197b537d777c928f7322851a32da699607500e1 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 2 Oct 2023 23:01:54 +0200 Subject: [PATCH] Add code formatting configuration with clang-format --- .clang-format | 5 +++++ scripts/reformat-all.sh | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .clang-format create mode 100755 scripts/reformat-all.sh diff --git a/.clang-format b/.clang-format new file mode 100644 index 00000000..298a0837 --- /dev/null +++ b/.clang-format @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: LLVM +AlignArrayOfStructures: Left +ColumnLimit: 160 diff --git a/scripts/reformat-all.sh b/scripts/reformat-all.sh new file mode 100755 index 00000000..4717e1b7 --- /dev/null +++ b/scripts/reformat-all.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# Go to repository root +cd "$(dirname "$0")/.." || exit 2 + +find ./src ./test -iname '*.h' -o -iname '*.cpp' | xargs clang-format -i \ No newline at end of file