From dac3f327c86fe5fac7682b2ee8cce6197f279771 Mon Sep 17 00:00:00 2001 From: Brandon Sutherland Date: Thu, 29 Feb 2024 13:25:01 -0700 Subject: [PATCH] added clang-format file and script --- .clang-format | 2 +- fix_code_style.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.clang-format b/.clang-format index 768dee3..536a180 100644 --- a/.clang-format +++ b/.clang-format @@ -33,7 +33,7 @@ BraceWrapping: SplitEmptyRecord: true BreakBeforeBinaryOperators: NonAssignment BreakBeforeTernaryOperators: true -BreakConstructorInitializers: BeforeColon +BreakConstructorInitializers: BeforeComma BreakInheritanceList: BeforeColon ColumnLimit: 100 CompactNamespaces: false diff --git a/fix_code_style.sh b/fix_code_style.sh index c97935e..b8ebb86 100755 --- a/fix_code_style.sh +++ b/fix_code_style.sh @@ -6,9 +6,9 @@ SCRIPTPATH=`dirname $SCRIPT` cd $SCRIPTPATH # Find all files with ".hpp" or ".cpp" extensions in the current directory and subdirectories, -# excluding certain paths (.rosflight/include/mavlink/v1.0/, ./rosflight_firmware/firmware/, and ./.git) +# excluding certain paths (./.git) find . -iname "*.hpp" -o -iname "*.cpp" | \ -egrep -v "^(.rosflight/include/mavlink/v1.0/|./rosflight_firmware/firmware/|./.git)" | \ +grep -Ev "^(./.git)" | \ # Format the files according to the rules specified in .clang-format xargs clang-format -i