Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpp-seminar
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Marco Bubke
cpp-seminar
Commits
f2f8be67
Commit
f2f8be67
authored
Jan 22, 2019
by
Marco Bubke
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add clang format file
parent
d026752d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
52 additions
and
54 deletions
+52
-54
.clang-format
.clang-format
+52
-54
No files found.
.clang-format
View file @
f2f8be67
# .clang-format for Qt Creator
#
# This is for clang-format >= 5.0.
#
# The configuration below follows the Qt Creator Coding Rules [1] as closely as
# possible. For documentation of the options, see [2].
#
# Use ../../tests/manual/clang-format-for-qtc/test.cpp for documenting problems
# or testing changes.
#
# [1] https://doc-snapshots.qt.io/qtcreator-extending/coding-style.html
# [2] https://clang.llvm.org/docs/ClangFormatStyleOptions.html
#
---
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines:
Right
AlignOperands:
fals
e
AlignEscapedNewlines:
DontAlign
AlignOperands:
tru
e
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine:
All
AllowShortFunctionsOnASingleLine:
Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations:
MultiLin
e
BinPackArguments:
tru
e
BinPackParameters:
tru
e
BraceWrapping:
AfterClass:
fals
e
AlwaysBreakTemplateDeclarations:
tru
e
BinPackArguments:
fals
e
BinPackParameters:
fals
e
BraceWrapping:
AfterClass:
tru
e
AfterControlStatement: false
AfterEnum: false
AfterFunction:
fals
e
AfterFunction:
tru
e
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct:
fals
e
AfterStruct:
tru
e
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction:
tru
e
SplitEmptyRecord:
tru
e
SplitEmptyNamespace:
tru
e
BreakBeforeBinaryOperators:
None
SplitEmptyFunction:
fals
e
SplitEmptyRecord:
fals
e
SplitEmptyNamespace:
fals
e
BreakBeforeBinaryOperators:
All
BreakBeforeBraces: Custom
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeCo
lon
BreakConstructorInitializers: BeforeCo
mma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit:
8
0
ColumnLimit:
10
0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
...
...
@@ -55,63 +65,51 @@ DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
ForEachMacros:
- forever # avoids { wrapped to next line
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeCategories:
- Regex: '^<Q.*'
Priority: 200
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
IndentPPDirectives: None
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
Keep
LineBreaksForNonEmptyLine
s: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin:
''
MacroBlockEnd:
''
Keep
EmptyLinesAtTheStartOfBlock
s: false
# Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between.
MacroBlockBegin:
""
MacroBlockEnd:
""
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBlockIndentWidth: 4
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PenaltyBreakAssignment: 500
PenaltyBreakBeforeFirstCallParameter: 150
PenaltyBreakComment: 500
PenaltyBreakFirstLessLess: 400
PenaltyBreakString: 600
PenaltyExcessCharacter: 7
PenaltyReturnTypeOnItsOwnLine: 300
PointerAlignment: Right
ReflowComments:
tru
e
ReflowComments:
fals
e
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast:
fals
e
SpaceAfterTemplateKeyword:
tru
e
SpaceAfterCStyleCast:
tru
e
SpaceAfterTemplateKeyword:
fals
e
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals:
tru
e
SpacesInContainerLiterals:
fals
e
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth:
8
TabWidth:
4
UseTab: Never
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment