Skip to content

Commit

Permalink
MNT: move away from the clang-format action and use our script directly
Browse files Browse the repository at this point in the history
  • Loading branch information
JJL772 committed Aug 16, 2023
1 parent c99ce62 commit 8e804c0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/ci-scripts-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,10 @@ jobs:
name: clang-format formatting check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: clang-format check
uses: jidicula/[email protected]
with:
clang-format-version: '16'
check-path: 'ek9000App'
exclude-regex: 'terminals.h'
- uses: actions/checkout@v3
- run: sudo apt-get update && sudo apt-get -y install clang-format-15
- run: CLANG_FORMAT=clang-format-15 CI=1 ./clang-format.sh


scripts-check:
name: Scripts Check
Expand Down
8 changes: 6 additions & 2 deletions clang-format.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

CLANG_FMT=$(which clang-format-14 || echo "clang-format")
[ -z "$CLANG_FORMAT" ] && CLANG_FORMAT=clang-format

$CLANG_FMT -i $(find . -iname "*.cpp" -o -iname "*.h")
if [[ $CI -eq 1 ]]; then
ARGS="-Werror --dry-run"
fi

$CLANG_FORMAT $ARGS -i $(find . -iname "*.cpp" -o -iname "*.h")

0 comments on commit 8e804c0

Please sign in to comment.