Skip to content

Commit

Permalink
#2: clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
levBagryansky committed Oct 5, 2023
1 parent 5ff87d0 commit 2b1ee93
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/clang-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,11 @@ jobs:
strategy:
matrix:
path:
- 'src'
- 'include'
- 'test'
- 'src & include'
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/clang-format-action@v4.9.0
uses: jidicula/clang-fo rmat-action@v4.9.0
with:
clang-format-version: '16'
check-path: ${{ github.workspace }}/${{ matrix.path }}
4 changes: 1 addition & 3 deletions src/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#include <iostream>

int main() {
std::cout << "Hello world" << std::endl;
}
int main() { std::cout << "Hello world" << std::endl; }
8 changes: 8 additions & 0 deletions tools/clang-format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
if [ ! -d "$1" ]; then
exit 0
fi

find $1 -name '*.cpp' -or -name '*.hpp' -or \
-name '*.hxx' -or -name '*.cxx' -or \
-name '*.h' | \
xargs -n 1 clang-format -i

0 comments on commit 2b1ee93

Please sign in to comment.