Skip to content

Commit f34bf24

Browse files
authored
Issue open-source-parsers#958: Travis CI should enforce clang-format standards (open-source-parsers#1026)
* Issue open-source-parsers#958: Travis CI should enfore clang-format standards This patch adds clang format support to the travis bots. * Update path * Roll back to version 8 since 9 is in test * Cleanup clang * Revert "Delete JSONCPP_DEPRECATED, use [[deprecated]] instead. (open-source-parsers#978)" (open-source-parsers#1029) This reverts commit b27c83f.
1 parent c4bc6da commit f34bf24

File tree

15 files changed

+511
-249
lines changed

15 files changed

+511
-249
lines changed

.clang-format

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,4 @@
1-
---
2-
# BasedOnStyle: LLVM
3-
AccessModifierOffset: -2
4-
ConstructorInitializerIndentWidth: 4
5-
AlignEscapedNewlinesLeft: false
6-
AlignTrailingComments: true
7-
AllowAllParametersOfDeclarationOnNextLine: true
8-
AllowShortIfStatementsOnASingleLine: false
9-
AllowShortLoopsOnASingleLine: false
10-
AlwaysBreakTemplateDeclarations: false
11-
AlwaysBreakBeforeMultilineStrings: false
12-
BreakBeforeBinaryOperators: false
13-
BreakBeforeTernaryOperators: true
14-
BreakConstructorInitializersBeforeComma: false
15-
BinPackParameters: false
16-
ColumnLimit: 80
17-
ConstructorInitializerAllOnOneLineOrOnePerLine: false
18-
DerivePointerBinding: false
19-
ExperimentalAutoDetectBinPacking: false
20-
IndentCaseLabels: false
21-
MaxEmptyLinesToKeep: 1
22-
NamespaceIndentation: None
23-
ObjCSpaceBeforeProtocolList: true
24-
PenaltyBreakBeforeFirstCallParameter: 19
25-
PenaltyBreakComment: 60
26-
PenaltyBreakString: 1000
27-
PenaltyBreakFirstLessLess: 120
28-
PenaltyExcessCharacter: 1000000
29-
PenaltyReturnTypeOnItsOwnLine: 60
30-
PointerBindsToType: true
31-
SpacesBeforeTrailingComments: 1
32-
Cpp11BracedListStyle: true
33-
Standard: Cpp11
34-
IndentWidth: 2
35-
TabWidth: 8
36-
UseTab: Never
37-
BreakBeforeBraces: Attach
38-
IndentFunctionDeclarationAfterType: false
39-
SpacesInParentheses: false
40-
SpacesInAngles: false
41-
SpaceInEmptyParentheses: false
42-
SpacesInCStyleCastParentheses: false
43-
SpaceAfterControlStatementKeyword: true
44-
SpaceBeforeAssignmentOperators: true
45-
ContinuationIndentWidth: 4
46-
...
1+
BasedOnStyle: LLVM
2+
DerivePointerAlignment: false
3+
PointerAlignment: Left
474

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ sudo: false
99
addons:
1010
homebrew:
1111
packages:
12+
- clang-format
1213
- meson
1314
- ninja
1415
update: false # do not update homebrew by default
@@ -17,6 +18,7 @@ addons:
1718
- ubuntu-toolchain-r-test
1819
- llvm-toolchain-xenial-8
1920
packages:
21+
- clang-format-8
2022
- clang-8
2123
- valgrind
2224
matrix:
@@ -25,7 +27,7 @@ matrix:
2527
include:
2628
- name: Mac clang meson static release testing
2729
os: osx
28-
osx_image: xcode10.2
30+
osx_image: xcode11
2931
compiler: clang
3032
env:
3133
CXX="clang++"

.travis_scripts/meson_builder.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ meson --version
6363
ninja --version
6464
_COMPILER_NAME=`basename ${CXX}`
6565
_BUILD_DIR_NAME="build-${BUILD_TYPE}_${LIB_TYPE}_${_COMPILER_NAME}"
66+
67+
./.travis_scripts/run-clang-format.sh
6668
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . "${_BUILD_DIR_NAME}"
6769
ninja -v -j 2 -C "${_BUILD_DIR_NAME}"
68-
#ninja -v -j 2 -C "${_BUILD_DIR_NAME}" test
70+
6971
cd "${_BUILD_DIR_NAME}"
7072
meson test --no-rebuild --print-errorlogs
7173

0 commit comments

Comments
 (0)