Skip to content

Commit

Permalink
Update clang-format configuration
Browse files Browse the repository at this point in the history
Summary:
Update clang-format configuration:
- Don't align escaped new lines in macro definitions
- Auto-detect "bin packing" for parameters
- Set line length to 100 characters
- Don't reorder include directives.
- Automatically add comments like `}  // namespace foo`

Test Plan: Jenkins: skip

Reviewers: sergei, timur

Reviewed By: sergei, timur

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D7698
  • Loading branch information
mbautin committed Dec 15, 2019
1 parent 2bff3ea commit a382f9a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ AccessModifierOffset: -1
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: true
AlignEscapedNewlines: DontAlign
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
Expand Down Expand Up @@ -52,7 +52,7 @@ ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
ExperimentalAutoDetectBinPacking: true
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^<.*\.h>'
Expand Down Expand Up @@ -83,7 +83,7 @@ PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortIncludes: false
SpaceAfterCStyleCast: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
Expand All @@ -97,4 +97,6 @@ SpacesInSquareBrackets: false
Standard: Auto
TabWidth: 8
UseTab: Never
ColumnLimit: 100
FixNamespaceComments: true
...

0 comments on commit a382f9a

Please sign in to comment.