diff --git a/.clang-format b/.clang-format index ee5cc2929cd..1860526f5f2 100644 --- a/.clang-format +++ b/.clang-format @@ -52,16 +52,17 @@ UseTab: Never BreakBeforeBraces: Custom # Control of individual brace wrapping cases -BraceWrapping: { - AfterClass: 'true', - AfterControlStatement: 'true', - AfterEnum : 'true', - AfterFunction : 'true', - AfterNamespace : 'true', - AfterStruct : 'true', - AfterUnion : 'true', - BeforeCatch : 'true', - BeforeElse : 'true', - IndentBraces : 'false', -} +BraceWrapping: + AfterCaseLabel : 'true' + AfterClass: 'true' + AfterControlStatement: 'true' + AfterEnum : 'true' + AfterFunction : 'true' + AfterNamespace : 'true' + AfterStruct : 'true' + AfterUnion : 'true' + BeforeCatch : 'true' + BeforeElse : 'true' + IndentBraces : 'false' + ... diff --git a/.github/workflows/clang_format.yml b/.github/workflows/clang_format.yml index 089a88125fc..4a11112d563 100644 --- a/.github/workflows/clang_format.yml +++ b/.github/workflows/clang_format.yml @@ -15,16 +15,17 @@ on: jobs: clang_format: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v1 - name: Run clang format run: | sudo apt update - sudo apt install -y git clang-format-8 + sudo apt install -y git clang-format-12 if [ $? -ge 1 ]; then return 1; fi ./.run-clang-format if [ $? -ge 1 ]; then return 1; fi output=$(git diff) + echo $output if [ -n "$output" ]; then exit 1; else exit 0; fi diff --git a/.github/workflows/cmake_format.yml b/.github/workflows/cmake_format.yml index 501fbcbdf12..e2167fb9c89 100644 --- a/.github/workflows/cmake_format.yml +++ b/.github/workflows/cmake_format.yml @@ -8,8 +8,8 @@ on: pull_request: paths: - 'tesseract**' - - '.github/workflows/clang_format.yml' - - '**clang-format' + - '.github/workflows/cmake_format.yml' + - '**cmake-format' schedule: - cron: '0 5 * * *' diff --git a/.run-clang-format b/.run-clang-format index 47ce0c0406d..68fc043dc6b 100755 --- a/.run-clang-format +++ b/.run-clang-format @@ -1,2 +1,2 @@ #!/bin/bash -find . -type d \( -name bullet3_ros -o -name fcl_ros -o -name libccd_ros -o -name gtest_ros -o -name tesseract_ext \) -prune -o -type f -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\|hxx\)' -exec clang-format-8 -style=file -i {} \; +find . -type d \( -name bullet3_ros -o -name fcl_ros -o -name libccd_ros -o -name gtest_ros -o -name tesseract_ext \) -prune -o -type f -regex '.*\.\(cpp\|hpp\|cc\|cxx\|h\|hxx\)' -exec clang-format-12 -style=file -i {} \;