Add .clang-format and apply it

This commit is contained in:
2021-12-02 07:18:16 +00:00
parent e58dede1b6
commit cd5e2538df
103 changed files with 2714 additions and 2132 deletions

54
.clang-format Normal file
View File

@@ -0,0 +1,54 @@
---
AlwaysBreakTemplateDeclarations: true
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: true
AfterFunction: true
AfterStruct: true
AfterUnion: true
IndentBraces: false
BeforeElse: true
BeforeCatch: true
BreakStringLiterals: true
ColumnLimit: 100
CompactNamespaces: true
ContinuationIndentWidth: 2
Cpp11BracedListStyle: true
FixNamespaceComments: true
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^".*-messages\.hh"$'
Priority: 3
- Regex: '<catch2/'
Priority: 20
- Regex: '^"util/'
Priority: 2
- Regex: '^"gd/(libgen|nl_types)\.h"$'
Priority: 0
- Regex: '^"gd/'
Priority: 1
- Regex: '<[[:alnum:]_.]+>'
Priority: 100
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
Language: Cpp
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpacesBeforeTrailingComments: 2
SpacesInAngles: false
Standard: Cpp11
...