File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ DerivePointerAlignment: false
46
46
DisableFormat : false
47
47
ExperimentalAutoDetectBinPacking : false
48
48
ForEachMacros : []
49
- IncludeBlocks : Preserve
50
49
IncludeCategories :
51
50
- Regex : ' ^"(llvm|llvm-c|clang|clang-c)/'
52
51
Priority : 2
@@ -55,7 +54,6 @@ IncludeCategories:
55
54
- Regex : ' .*'
56
55
Priority : 1
57
56
IndentCaseLabels : true
58
- IndentPPDirectives : None
59
57
IndentWidth : 4
60
58
IndentWrappedFunctionNames : false
61
59
KeepEmptyLinesAtTheStartOfBlocks : true
Original file line number Diff line number Diff line change @@ -12,6 +12,28 @@ if test x"$1" = xchanged; then
12
12
FILES=" $FILES1 $FILES2 $FILES3 "
13
13
fi
14
14
15
+ # Find clang-format, we prefer -6.0, but also allow binaries without -suffix as
16
+ # long as they're >= 6.0.0
17
+ CLANG_FORMAT=` which clang-format-6.0`
18
+
19
+ if [ -z " $CLANG_FORMAT " ]; then
20
+ CLANG_FORMAT=` which clang-format`
21
+ fi
22
+
23
+ if [ -z " $CLANG_FORMAT " ]; then
24
+ echo " Couldn't find clang-format"
25
+ exit
26
+ fi
27
+
28
+ VERSION=` $CLANG_FORMAT -version | cut -d " " -f 3`
29
+ VERSION_MAJOR=` echo $VERSION | cut -d " ." -f 1`
30
+
31
+ if [ $VERSION_MAJOR -lt 6 ]; then
32
+ echo " Found clang-format $VERSION but we need >= 6.0.0"
33
+ exit
34
+ fi
35
+
36
+ # Run formatter
15
37
for i in $FILES ; do
16
- clang-format-7 -i $i
38
+ $CLANG_FORMAT -i $i
17
39
done
You can’t perform that action at this time.
0 commit comments