Add clang-format sample
This commit is contained in:
12
clang-format/README.org
Normal file
12
clang-format/README.org
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
* Clang-format
|
||||||
|
Smaple config for ~clang-format~.
|
||||||
|
|
||||||
|
Usage: copy sample to your cpp project dir root, renaming it to
|
||||||
|
~.clang-format~, adjust if needed, then call
|
||||||
|
~clang-format --style=file -i <path-to-file>~
|
||||||
|
|
||||||
|
To format all files at once, use the following method:
|
||||||
|
|
||||||
|
~find . -type f -not -path '*/.*' -type f \( -name '*.cpp' -o -name '*.hpp' \) -exec clang-format --style=file -i {} \;~
|
||||||
|
|
||||||
|
Clang format options quick overview: [[http://clangformat.com/]]
|
||||||
51
clang-format/clang-format-sample
Normal file
51
clang-format/clang-format-sample
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
---
|
||||||
|
AccessModifierOffset: '-4'
|
||||||
|
AlignAfterOpenBracket: true
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignEscapedNewlines: true
|
||||||
|
AlignOperands: false
|
||||||
|
AlignTrailingComments: false
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortBlocksOnASingleLine: false
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
|
AllowShortIfStatementsOnASingleLine: false
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakAfterDefinitionReturnType: false
|
||||||
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
|
AlwaysBreakTemplateDeclarations: true
|
||||||
|
BreakBeforeBinaryOperators: None
|
||||||
|
BreakBeforeBraces: Attach
|
||||||
|
BreakBeforeTernaryOperators: false
|
||||||
|
BreakConstructorInitializersBeforeComma: true
|
||||||
|
ColumnLimit: '0'
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
Cpp11BracedListStyle: false
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
FixNamespaceComments: true
|
||||||
|
IncludeBlocks: Preserve
|
||||||
|
IndentCaseLabels: false
|
||||||
|
IndentPPDirectives: AfterHash
|
||||||
|
IndentWidth: '4'
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
|
Language: Cpp
|
||||||
|
MaxEmptyLinesToKeep: '1'
|
||||||
|
NamespaceIndentation: None
|
||||||
|
PenaltyBreakAssignment: 0
|
||||||
|
PenaltyBreakBeforeFirstCallParameter: 100
|
||||||
|
PenaltyBreakComment: 300
|
||||||
|
PenaltyBreakFirstLessLess: 120
|
||||||
|
PenaltyBreakString: 120
|
||||||
|
PenaltyExcessCharacter: 1
|
||||||
|
PenaltyReturnTypeOnItsOwnLine: 120
|
||||||
|
PointerAlignment: Right
|
||||||
|
ReflowComments: false
|
||||||
|
SortIncludes: true
|
||||||
|
SortUsingDeclarations: true
|
||||||
|
SpacesBeforeTrailingComments: 1
|
||||||
|
Standard: Cpp11
|
||||||
|
TabWidth: '4'
|
||||||
|
UseTab: Never
|
||||||
|
...
|
||||||
Reference in New Issue
Block a user