forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add .clang-format with near current style (ClickHouse#383)
* renamed: debian/compressor-metrika-yandex.install -> debian/clickhouse-compressor-metrika-yandex.install * Add clang-format config * add message
- Loading branch information
1 parent
b8f1ea4
commit 4beb53d
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
--- | ||
BasedOnStyle: WebKit | ||
Language: Cpp | ||
AlignAfterOpenBracket: false | ||
BreakBeforeBraces: Allman | ||
BreakConstructorInitializersBeforeComma: false | ||
Cpp11BracedListStyle: false | ||
ColumnLimit: 140 | ||
ConstructorInitializerAllOnOneLineOrOnePerLine: true | ||
ExperimentalAutoDetectBinPacking: true | ||
UseTab: Always | ||
Standard: Cpp11 | ||
TabWidth: 4 | ||
PointerAlignment: Middle | ||
MaxEmptyLinesToKeep: 2 | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
#AllowShortFunctionsOnASingleLine: Inline | ||
AllowShortFunctionsOnASingleLine: Empty | ||
AlwaysBreakTemplateDeclarations: true | ||
#SpaceAfterTemplateKeyword: true | ||
SortIncludes: true | ||
IncludeCategories: | ||
- Regex: '^<[a-z_]+>' | ||
Priority: 1 | ||
- Regex: '^<[a-z_]+.h>' | ||
Priority: 2 | ||
- Regex: '^["<](common|ext|mysqlxx|daemon)/' | ||
Priority: 90 | ||
- Regex: '^["<](DB)/' | ||
Priority: 100 | ||
- Regex: '^["<](Poco)/' | ||
Priority: 50 | ||
- Regex: '/' | ||
Priority: 30 | ||
- Regex: '.*' | ||
Priority: 40 | ||
ReflowComments: false | ||
|
||
# Not changed: | ||
AccessModifierOffset: -4 | ||
AlignConsecutiveAssignments: false | ||
AlignEscapedNewlinesLeft: false | ||
AlignOperands: false | ||
AlignTrailingComments: false | ||
AllowAllParametersOfDeclarationOnNextLine: true | ||
AllowShortBlocksOnASingleLine: false | ||
AllowShortCaseLabelsOnASingleLine: false | ||
AllowShortIfStatementsOnASingleLine: false | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: false | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BreakBeforeBinaryOperators: All | ||
BreakBeforeTernaryOperators: true | ||
CommentPragmas: '^ IWYU pragma:' | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] | ||
IndentCaseLabels: false | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: false | ||
MacroBlockBegin: '' | ||
MacroBlockEnd: '' | ||
NamespaceIndentation: Inner | ||
ObjCBlockIndentWidth: 4 | ||
ObjCSpaceAfterProperty: true | ||
ObjCSpaceBeforeProtocolList: true | ||
PenaltyBreakBeforeFirstCallParameter: 19 | ||
PenaltyBreakComment: 300 | ||
PenaltyBreakFirstLessLess: 120 | ||
PenaltyBreakString: 1000 | ||
PenaltyExcessCharacter: 1000000 | ||
PenaltyReturnTypeOnItsOwnLine: 60 | ||
SpaceAfterCStyleCast: false | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeParens: ControlStatements | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInContainerLiterals: true | ||
SpacesInCStyleCastParentheses: false | ||
SpacesInParentheses: false | ||
SpacesInSquareBrackets: false | ||
... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#/usr/bin/env bash | ||
|
||
clang_format=`bash -c "compgen -c clang-format | grep 'clang-format-[[:digit:]]' | sort --version-sort --reverse | head -n1"` | ||
if [ ! -z $clang_format ]; then | ||
find dbms libs utils -name *.cpp -or -name *.h -exec $clang_format -i {} + ; | ||
else | ||
echo clang-format missing. try to install: | ||
echo sudo apt install clang-format | ||
echo or | ||
echo sudo apt install clang-format-3.9 | ||
fi |