Permalink
Browse files

applying clang-format

* adding .clang-format file
* run `make format` to apply formatting
* check format in travis as well
  • Loading branch information...
toanju committed Feb 3, 2017
1 parent 49f63b8 commit eb84e3a7a0b182679ab7035828e2ab867203b395
Showing 534 changed files with 102,808 additions and 120,634 deletions.
View
@@ -0,0 +1,90 @@
+---
+Language: Cpp
+# BasedOnStyle: LLVM
+AccessModifierOffset: -2
+AlignAfterOpenBracket: Align
+AlignConsecutiveAssignments: false
+AlignConsecutiveDeclarations: false
+AlignEscapedNewlinesLeft: false
+AlignOperands: true
+AlignTrailingComments: true
+AllowAllParametersOfDeclarationOnNextLine: true
+AllowShortBlocksOnASingleLine: false
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: All
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterDefinitionReturnType: None
+AlwaysBreakAfterReturnType: None
+AlwaysBreakBeforeMultilineStrings: false
+AlwaysBreakTemplateDeclarations: false
+BinPackArguments: true
+BinPackParameters: true
+BraceWrapping:
+ AfterClass: false
+ AfterControlStatement: false
+ AfterEnum: false
+ AfterFunction: false
+ AfterNamespace: false
+ AfterObjCDeclaration: false
+ AfterStruct: false
+ AfterUnion: false
+ BeforeCatch: false
+ BeforeElse: false
+ IndentBraces: false
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Attach
+BreakBeforeTernaryOperators: true
+BreakConstructorInitializersBeforeComma: false
+ColumnLimit: 80
+CommentPragmas: '^ IWYU pragma:'
+ConstructorInitializerAllOnOneLineOrOnePerLine: false
+ConstructorInitializerIndentWidth: 4
+ContinuationIndentWidth: 4
+Cpp11BracedListStyle: true
+DerivePointerAlignment: false
+DisableFormat: false
+ExperimentalAutoDetectBinPacking: false
+ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
+IncludeCategories:
+ - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
+ Priority: 2
+ - Regex: '^(<|"(gtest|isl|json)/)'
+ Priority: 3
+ - Regex: '.*'
+ Priority: 1
+IndentCaseLabels: false
+IndentWidth: 2
+IndentWrappedFunctionNames: false
+KeepEmptyLinesAtTheStartOfBlocks: true
+MacroBlockBegin: ''
+MacroBlockEnd: ''
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: None
+ObjCBlockIndentWidth: 2
+ObjCSpaceAfterProperty: false
+ObjCSpaceBeforeProtocolList: true
+PenaltyBreakBeforeFirstCallParameter: 19
+PenaltyBreakComment: 300
+PenaltyBreakFirstLessLess: 120
+PenaltyBreakString: 1000
+PenaltyExcessCharacter: 1000000
+PenaltyReturnTypeOnItsOwnLine: 60
+PointerAlignment: Right
+ReflowComments: true
+SortIncludes: true
+SpaceAfterCStyleCast: false
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeParens: ControlStatements
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: false
+SpacesInContainerLiterals: true
+SpacesInCStyleCastParentheses: false
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+Standard: Cpp11
+TabWidth: 8
+UseTab: Never
+...
+
View
@@ -45,5 +45,6 @@ test-driver
/src/rofl_common_conf.h
/tools/rpmbuild/SPECS/rofl-common.spec
+!.clang-format
!.gitignore
!.travis.yml
View
@@ -6,7 +6,7 @@ compiler:
- clang
before_install:
- sudo apt-get update -qq
- - sudo apt-get install -y -qq libssl-dev libcunit1-dev libcppunit-dev libgoogle-glog-dev
+ - sudo apt-get install -y -qq libssl-dev libcunit1-dev libcppunit-dev libgoogle-glog-dev clang-format-3.8
install:
- ./autogen.sh
env:
@@ -16,6 +16,8 @@ script:
- mkdir -p build
- cd build
- ../configure $FLAGS
+ - find .. -regex '.*\.\(hh?\|cc?\|hpp\|cpp\)$$' | xargs clang-format-3.8 -i -style=file
+ - git diff --exit-code
- make -j 2
- VERBOSE=yes make -j 2 check
branches:
View
@@ -17,10 +17,13 @@ EXTRA_DIST = \
VERSION
#Could be improved..
-.PHONY: doc
+.PHONY: doc format
doc:
@cd doc/ && make doc
+format:
+ find $(top_srcdir) -regex '.*\.\(hh?\|cc?\|hpp\|cpp\)$$' | xargs clang-format -i -style=file
+
install-exec-hook:
uninstall-hook:
Oops, something went wrong.

0 comments on commit eb84e3a

Please sign in to comment.