foundationdb/.clang-format
Alex Miller 2b646c98af Add a clang-format config file.
The rewrites done to our code aren't ... entirely great, and I don't have the
time to walk over each file and individually fix any clang-format mistakes or
awkwardmess.

I'm adding the config file so that we can fix issues over time, and any file
that I go to edit will get converted into our New One True Coding Style.  I
don't mean for this to be a pedantic coding style, and if your change looks
more readable with a line width of 105 characters, then go for it.

Note that CommentPragmas means //TraceEvent lines are ignored and not comment
reflowed, and any clang-format weirdness on a line can either be disabled
via...

    // clang-format: off
        The code to ignore
    That has some weird formatting
        Intentionally
    // clang-format: on

Or for a single line

    ar & a & b & c;  // clang-format: ignore

This is also not intended to be the inarguable final form of our coding style
config.  It's totally possible that I've missed something, or that a different
line length would end up causing our existing code to look better.
2018-03-29 12:10:12 -07:00

67 lines
2.0 KiB
YAML

Language: Cpp
# BasedOnStyle: Mozilla
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:|^ clang-format: ignore$|^TraceEvent'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: ForIndentation