File tree 3 files changed +38
-4
lines changed 3 files changed +38
-4
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ AccessModifierOffset: -2
5
5
AlignAfterOpenBracket : Align
6
6
AlignArrayOfStructures : None
7
7
AlignConsecutiveAssignments :
8
- Enabled : true
8
+ Enabled : true
9
9
AcrossEmptyLines : false
10
10
AcrossComments : false
11
11
AlignCompound : false
@@ -26,7 +26,7 @@ AlignConsecutiveDeclarations:
26
26
AlignFunctionPointers : false
27
27
PadOperators : false
28
28
AlignConsecutiveMacros :
29
- Enabled : false
29
+ Enabled : false
30
30
AcrossEmptyLines : false
31
31
AcrossComments : false
32
32
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
2
2
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