File tree 3 files changed +42
-15
lines changed
3 files changed +42
-15
lines changed Original file line number Diff line number Diff line change 24
24
- ' .github/workflows/**.yml'
25
25
26
26
jobs :
27
- clang_format :
28
- runs-on : ubuntu-18.04
29
- steps :
30
- - uses : actions/checkout@v2
31
- - name : Install clang-format
32
- run : |
33
- sudo apt-get install clang-format-9 -qyy
34
27
35
- - name : Run clang-format
36
- run : |
37
- source ./util/ci/lint.sh
38
- perform_lint
39
- env :
40
- CLANG_FORMAT : clang-format-9
28
+ # clang_format:
29
+ # runs-on: ubuntu-18.04
30
+ # steps:
31
+ # - uses: actions/checkout@v2
32
+ # - name: Install clang-format
33
+ # run: |
34
+ # sudo apt-get install clang-format-9 -qyy
35
+ #
36
+ # - name: Run clang-format
37
+ # run: |
38
+ # source ./util/ci/clang-format.sh
39
+ # check_format
40
+ # env:
41
+ # CLANG_FORMAT: clang-format-9
41
42
42
43
clang_tidy :
43
44
runs-on : ubuntu-18.04
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- function perform_lint() {
3
- echo " Performing LINT... "
2
+
3
+ function setup_for_format() {
4
4
if [ -z " ${CLANG_FORMAT} " ]; then
5
5
CLANG_FORMAT=clang-format
6
6
fi
7
7
echo " LINT: Using binary $CLANG_FORMAT "
8
8
CLANG_FORMAT_WHITELIST=" util/ci/clang-format-whitelist.txt"
9
9
10
10
files_to_lint=" $( find src/ -name ' *.cpp' -or -name ' *.h' ) "
11
+ }
12
+
13
+ function check_format() {
14
+ echo " Checking format..."
15
+
16
+ setup_for_format
11
17
12
18
local errorcount=0
13
19
local fail=0
@@ -41,3 +47,18 @@ function perform_lint() {
41
47
echo " LINT OK"
42
48
}
43
49
50
+
51
+
52
+ function fix_format() {
53
+ echo " Fixing format..."
54
+
55
+ setup_for_format
56
+
57
+ for f in ${files_to_lint} ; do
58
+ whitelisted=$( awk ' $1 == "' $f ' " { print 1 }' " $CLANG_FORMAT_WHITELIST " )
59
+ if [ -z " ${whitelisted} " ]; then
60
+ echo " $f "
61
+ $CLANG_FORMAT -i " $f "
62
+ fi
63
+ done
64
+ }
Original file line number Diff line number Diff line change
1
+ #! /bin/bash -e
2
+
3
+ . ./util/ci/clang-format.sh
4
+
5
+ fix_format
You can’t perform that action at this time.
0 commit comments