File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+
3
+ SOURCES=$( find $( git rev-parse --show-toplevel) | egrep " \.(cpp|cc|c|h)\$ " )
4
+
5
+ CLANG_FORMAT=$( which clang-format-11)
6
+ if [ $? -ne 0 ]; then
7
+ CLANG_FORMAT=$( which clang-format)
8
+ if [ $? -ne 0 ]; then
9
+ echo " [!] clang-format not installed. Unable to check source file format policy." >&2
10
+ exit 1
11
+ fi
12
+ fi
13
+
14
+ set -x
15
+
16
+ for file in ${SOURCES} ;
17
+ do
18
+ $CLANG_FORMAT ${file} > expected-format
19
+ diff -u -p --label=" ${file} " --label=" expected coding style" ${file} expected-format
20
+ done
21
+ exit $( $CLANG_FORMAT --output-replacements-xml ${SOURCES} | egrep -c " </replacement>" )
Original file line number Diff line number Diff line change 35
35
lkmpg-html.tar.gz
36
36
tag_name : " latest"
37
37
prerelease : true
38
+
39
+ coding_style :
40
+ runs-on : ubuntu-20.04
41
+ steps :
42
+ - name : checkout code
43
+ uses : actions/checkout@v2
44
+ - name : style check
45
+ run : |
46
+ sudo apt-get install -q -y clang-format-11
47
+ sh .ci/check-format.sh
48
+ shell : bash
Original file line number Diff line number Diff line change @@ -29,3 +29,6 @@ lkmpg.pdf
29
29
* .lg
30
30
* .idv
31
31
* .xref
32
+
33
+ # format checks
34
+ expected-format
You can’t perform that action at this time.
0 commit comments