Skip to content

Commit

Permalink
Update to leverage clang-format-12
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Armstrong committed Oct 30, 2024
1 parent 405a63d commit 67a83c7
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
25 changes: 13 additions & 12 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -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'

...
5 changes: 3 additions & 2 deletions .github/workflows/clang_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/workflows/cmake_format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 * * *'

Expand Down
2 changes: 1 addition & 1 deletion .run-clang-format
Original file line number Diff line number Diff line change
@@ -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 {} \;

0 comments on commit 67a83c7

Please sign in to comment.