2018-07-31 11:33:35 +02:00
|
|
|
# Checkout config tool: https://zed0.co.uk/clang-format-configurator/
|
|
|
|
# Or http://cf.monofraps.net/
|
|
|
|
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
|
|
|
|
# https://github.com/01org/parameter-framework/blob/master/.clang-format
|
|
|
|
|
2019-06-29 11:27:38 +02:00
|
|
|
# Tested on: clang-format version 8.0.0
|
|
|
|
# Version 1.1
|
2018-07-31 11:33:35 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Common settings
|
|
|
|
BasedOnStyle: WebKit
|
|
|
|
TabWidth: 4
|
|
|
|
IndentWidth: 4
|
2019-06-29 11:27:38 +02:00
|
|
|
UseTab: ForContinuationAndIndentation
|
2018-07-31 11:33:35 +02:00
|
|
|
ColumnLimit: 100
|
|
|
|
|
|
|
|
# Other languages JavaScript, Proto
|
|
|
|
|
|
|
|
---
|
|
|
|
Language: Cpp
|
|
|
|
|
|
|
|
# http://releases.llvm.org/6.0.1/tools/clang/docs/ClangFormatStyleOptions.html#disabling-formatting-on-a-piece-of-code
|
|
|
|
# int formatted_code;
|
|
|
|
# // clang-format off
|
|
|
|
# void unformatted_code ;
|
|
|
|
# // clang-format on
|
|
|
|
# void formatted_code_again;
|
|
|
|
|
|
|
|
DisableFormat: false
|
|
|
|
Standard: Cpp11
|
|
|
|
|
|
|
|
AccessModifierOffset: -4
|
|
|
|
AlignAfterOpenBracket: true
|
|
|
|
AlignConsecutiveAssignments: false
|
|
|
|
AlignConsecutiveDeclarations: false
|
|
|
|
AlignEscapedNewlinesLeft: false
|
|
|
|
AlignOperands: true
|
|
|
|
AlignTrailingComments: false
|
|
|
|
AllowAllParametersOfDeclarationOnNextLine: true
|
|
|
|
AllowShortBlocksOnASingleLine: false
|
|
|
|
AllowShortCaseLabelsOnASingleLine: false
|
|
|
|
AllowShortFunctionsOnASingleLine: Empty
|
|
|
|
AllowShortIfStatementsOnASingleLine: false
|
|
|
|
AllowShortLoopsOnASingleLine: false
|
|
|
|
AlwaysBreakAfterDefinitionReturnType: false
|
|
|
|
AlwaysBreakAfterReturnType: None
|
|
|
|
AlwaysBreakBeforeMultilineStrings: false
|
|
|
|
AlwaysBreakTemplateDeclarations: true
|
|
|
|
BinPackArguments: false
|
|
|
|
BinPackParameters: false
|
|
|
|
|
|
|
|
# Configure each individual brace in BraceWrapping
|
|
|
|
BreakBeforeBraces: Custom
|
|
|
|
# Control of individual brace wrapping cases
|
|
|
|
BraceWrapping: {
|
2019-06-29 11:27:38 +02:00
|
|
|
AfterClass: 'true'
|
2018-07-31 11:33:35 +02:00
|
|
|
AfterControlStatement: 'true'
|
2019-06-29 11:27:38 +02:00
|
|
|
AfterEnum: 'true'
|
|
|
|
AfterFunction: 'true'
|
|
|
|
AfterNamespace: 'true'
|
|
|
|
AfterStruct: 'true'
|
|
|
|
AfterUnion: 'true'
|
|
|
|
BeforeCatch: 'true'
|
|
|
|
BeforeElse: 'true'
|
|
|
|
IndentBraces: 'false'
|
|
|
|
AfterExternBlock: 'true'
|
|
|
|
SplitEmptyFunction: 'false'
|
|
|
|
SplitEmptyRecord: 'false'
|
|
|
|
SplitEmptyNamespace: 'true'
|
2018-07-31 11:33:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
BreakAfterJavaFieldAnnotations: true
|
|
|
|
BreakBeforeInheritanceComma: false
|
|
|
|
BreakBeforeBinaryOperators: None
|
|
|
|
BreakBeforeTernaryOperators: true
|
|
|
|
BreakConstructorInitializersBeforeComma: true
|
|
|
|
BreakStringLiterals: true
|
|
|
|
|
|
|
|
CommentPragmas: '^ IWYU pragma:'
|
|
|
|
CompactNamespaces: false
|
|
|
|
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
|
|
|
ConstructorInitializerIndentWidth: 4
|
|
|
|
ContinuationIndentWidth: 4
|
|
|
|
Cpp11BracedListStyle: true
|
2019-06-29 11:27:38 +02:00
|
|
|
SpaceBeforeCpp11BracedList: false
|
2018-07-31 11:33:35 +02:00
|
|
|
DerivePointerAlignment: false
|
|
|
|
ExperimentalAutoDetectBinPacking: false
|
|
|
|
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
|
2019-06-29 11:27:38 +02:00
|
|
|
IncludeCategories:
|
|
|
|
- Regex: '^<.*\..+'
|
|
|
|
Priority: 2
|
|
|
|
- Regex: '^<.*'
|
|
|
|
Priority: 1
|
|
|
|
- Regex: '.*'
|
|
|
|
Priority: 3
|
2018-07-31 11:33:35 +02:00
|
|
|
IndentCaseLabels: false
|
|
|
|
FixNamespaceComments: true
|
|
|
|
IndentWrappedFunctionNames: false
|
|
|
|
KeepEmptyLinesAtTheStartOfBlocks: true
|
|
|
|
MacroBlockBegin: ''
|
|
|
|
MacroBlockEnd: ''
|
|
|
|
JavaScriptQuotes: Double
|
|
|
|
MaxEmptyLinesToKeep: 1
|
|
|
|
NamespaceIndentation: None
|
|
|
|
ObjCBlockIndentWidth: 4
|
|
|
|
ObjCSpaceAfterProperty: true
|
|
|
|
ObjCSpaceBeforeProtocolList: true
|
|
|
|
PenaltyBreakBeforeFirstCallParameter: 19
|
|
|
|
PenaltyBreakComment: 300
|
|
|
|
PenaltyBreakFirstLessLess: 120
|
|
|
|
PenaltyBreakString: 1000
|
|
|
|
|
|
|
|
PenaltyExcessCharacter: 1000000
|
|
|
|
PenaltyReturnTypeOnItsOwnLine: 60
|
|
|
|
PointerAlignment: Left
|
|
|
|
SpaceAfterCStyleCast: false
|
|
|
|
SpaceBeforeAssignmentOperators: true
|
|
|
|
SpaceBeforeParens: Never
|
|
|
|
SpaceInEmptyParentheses: false
|
|
|
|
SpacesBeforeTrailingComments: 1
|
|
|
|
SpacesInAngles: false
|
|
|
|
SpacesInContainerLiterals: true
|
|
|
|
SpacesInCStyleCastParentheses: false
|
|
|
|
SpacesInParentheses: false
|
|
|
|
SpacesInSquareBrackets: false
|
|
|
|
SpaceAfterTemplateKeyword: true
|
2019-06-29 11:27:38 +02:00
|
|
|
SpaceBeforeInheritanceColon: true
|
2018-07-31 11:33:35 +02:00
|
|
|
|
|
|
|
SortUsingDeclarations: true
|
|
|
|
SortIncludes: true
|
|
|
|
|
2019-06-29 11:27:38 +02:00
|
|
|
# Comments are for developers, they should arrange them but now we allow for ReflowComments
|
|
|
|
# It should add at least 1 space after //
|
|
|
|
ReflowComments: true
|
2018-07-31 11:33:35 +02:00
|
|
|
|
2019-06-29 11:27:38 +02:00
|
|
|
IncludeBlocks: Regroup
|
2018-07-31 11:33:35 +02:00
|
|
|
IndentPPDirectives: AfterHash
|
|
|
|
---
|