File tree Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Expand file tree Collapse file tree 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ AccessModifierOffset: -2
55AlignAfterOpenBracket : Align
66AlignArrayOfStructures : None
77AlignConsecutiveAssignments :
8- Enabled : true
8+ Enabled : true
99 AcrossEmptyLines : false
1010 AcrossComments : false
1111 AlignCompound : false
@@ -26,7 +26,7 @@ AlignConsecutiveDeclarations:
2626 AlignFunctionPointers : false
2727 PadOperators : false
2828AlignConsecutiveMacros :
29- Enabled : false
29+ Enabled : false
3030 AcrossEmptyLines : false
3131 AcrossComments : false
3232 AlignCompound : false
Original file line number Diff line number Diff line change 1+ name : Clang formatting checker
2+
3+ on :
4+ push :
5+ branches : ["master"]
6+ pull_request :
7+ branches : ["master"]
8+
9+ jobs :
10+ build :
11+ runs-on : ubuntu-latest
12+ container :
13+ image : silkeh/clang # https://hub.docker.com/r/silkeh/clang
14+ env :
15+ DRY : " TRUE"
16+
17+ steps :
18+ - uses : actions/checkout@v4
19+ with :
20+ fetch-depth : 1
21+
22+ - name : Checking formatting
23+ run : DRY=TRUE bash reformat-all.sh
Original file line number Diff line number Diff line change 1- #! /bin/sh
1+ #! /usr/ bin/env bash
22
3- find . -name ' *.cpp' -o -name ' *.hpp' | xargs clang-format -i -style=file
3+ ALL_FORMATABLE_FILES=$( find src include tests example -name ' *.cpp' -o -name ' *.hpp' )
4+ CLANG_FORMAT_ARGS=" -style=file"
5+
6+ echo " *** Modbus Clang Format Wrapper **"
7+ clang-format --version
8+
9+ if [[ " $DRY " = " TRUE" ]]; then
10+ diff_count=` clang-format --dry-run $CLANG_FORMAT_ARGS $ALL_FORMATABLE_FILES 2>&1 | wc -l`
11+ exit $(( $diff_count > 0 ))
12+ else
13+ clang-format -i --verbose $CLANG_FORMAT_ARGS $ALL_FORMATABLE_FILES
14+ fi
You can’t perform that action at this time.
0 commit comments