From c734ede4e6c5a79862bca48b8c64b0e93e0f9d9e Mon Sep 17 00:00:00 2001 From: jake Date: Sun, 4 Aug 2024 09:27:15 -0700 Subject: [PATCH] fixed cli flags The style flag/option needed to be changed. Also removed problamatic line from config. --- .clang-format | 40 ++++++++++++++++++++++++++++++++++++++-- otto.sh | 6 +++--- 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/.clang-format b/.clang-format index b674f3e..c471cc8 100644 --- a/.clang-format +++ b/.clang-format @@ -1,5 +1,40 @@ -BasedOnStyle: None +# --- +Language: Cpp +# The Based on style flag causes nothing to work. +#BasedOnStyle: None AlignTrailingComments: true +AlignArrayOfStructures: Left + +AlignConsecutiveAssignments: + Enabled: true + AcrossEmptyLines: true + AcrossComments: false + +AlignConsecutiveBitFields: + Enabled: true + AcrossEmptyLines: true + AcrossComments: false + +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: true + AcrossComments: false + +AlignConsecutiveShortCaseStatements: + Enabled: true + AcrossEmptyLines: true + AcrossComments: true + AlignCaseColons: false + +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: true +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AllowShortIfStatementsOnASingleLine: true + BreakBeforeBraces: Allman ColumnLimit: 0 IndentWidth: 4 @@ -9,4 +44,5 @@ ObjCSpaceBeforeProtocolList: true PointerBindsToType: false SpacesBeforeTrailingComments: 1 TabWidth: 8 -UseTab: Neve +UseTab: Never + diff --git a/otto.sh b/otto.sh index 9b40d76..20de2c5 100755 --- a/otto.sh +++ b/otto.sh @@ -19,13 +19,13 @@ format_source_code () { #Get a list of all C files source_c_files=$(find ./src -name '*.c') for f in $source_c_files; do - clang-format -i -style=.clang-format $f + clang-format -i -style=file $f done #Get a list of all H files source_h_files=$(find ./src -name '*.h') for f in $source_h_files; do - clang-format -i -style=.clang-format $f + clang-format -i -style=file $f done echo "Applying Formating standard!" @@ -194,8 +194,8 @@ build_main () { } run_c_tests () { - clear_cmake_cache format_source_code + clear_cmake_cache cmake -DUNIT_TESTING=ON -DCMAKE_VERBOSE_MAKEFILE=${CMAKE_VERBOSE} ../ make AllTests && ./tests/AllTests }