Skip to content

Commit e38440e

Browse files
jbapple-clouderaaphadke
authored and
aphadke
committed
Match .clang-format more closely to actual practice.
In order to attempt to get code like double VeryLongFunctionNames(double x1, double x2, double x3, double x4) { return 1.0; } rather than double VeryLongFunctionNames( double x1, double x2, double x3, double x4) { return 1.0; } I wrote a small set of programs to infer which .clang-format params fit the current Impala codebase most closely; this patch is the result. This patch is the best the inferencer found (while maintaining certain enforced parameters, like 90-character lines). It is about 10% closer to Impala's current code base than the .clang-format that is checked in at the moment, as measured by number of lines in the diff. Change-Id: Iccaec6c1673c3e08d2c39200b0c84437af629aed Reviewed-on: http://gerrit.cloudera.org:8080/4590 Reviewed-by: Jim Apple <[email protected]> Tested-by: Jim Apple <[email protected]>
1 parent ed1c035 commit e38440e

File tree

1 file changed

+35
-14
lines changed

1 file changed

+35
-14
lines changed

.clang-format

+35-14
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
1+
---
2+
Language: Cpp
13
BasedOnStyle: Google
2-
AlignAfterOpenBracket: 'false'
3-
AlignOperands: 'false'
4-
AllowShortCaseLabelsOnASingleLine: 'true'
5-
AllowShortFunctionsOnASingleLine: 'Inline'
6-
AllowShortIfStatementsOnASingleLine: 'true'
7-
BreakBeforeBinaryOperators: 'NonAssignment'
8-
BreakBeforeTernaryOperators: 'false'
9-
ColumnLimit: '90'
10-
ConstructorInitializerIndentWidth: '2'
11-
ContinuationIndentWidth: '4'
12-
DerivePointerAlignment: 'false'
13-
PenaltyBreakBeforeFirstCallParameter: '99999999'
14-
SpacesBeforeTrailingComments: '1'
15-
Standard: 'Cpp11'
4+
AlignAfterOpenBracket: DontAlign
5+
AlignOperands: false
6+
AlignTrailingComments: false
7+
AllowShortFunctionsOnASingleLine: Inline
8+
AlwaysBreakBeforeMultilineStrings: false
9+
BreakBeforeBinaryOperators: NonAssignment
10+
BreakBeforeTernaryOperators: false
11+
ColumnLimit: 90
12+
ConstructorInitializerIndentWidth: 2
13+
DerivePointerAlignment: false
14+
IncludeCategories:
15+
- Priority: 3
16+
Regex: '^<.*/' # Like <boost/lexical_cast.hpp>
17+
- Priority: 1
18+
Regex: '^<.*\.' # Like <fcntl.h>
19+
- Priority: 2
20+
Regex: '^<' # Like <vector>
21+
- Priority: 4
22+
Regex: '^"' # Like "util/auth-util.h"
23+
SpacesBeforeTrailingComments: 1
24+
Standard: Cpp11
25+
---
26+
Language: Java
27+
BasedOnStyle: Chromium
28+
AllowShortCaseLabelsOnASingleLine: true
29+
AllowShortFunctionsOnASingleLine: All
30+
AlwaysBreakBeforeMultilineStrings: true
31+
BreakBeforeTernaryOperators: false
32+
ColumnLimit: 90
33+
ContinuationIndentWidth: 4
34+
IndentWidth: 2
35+
IndentWrappedFunctionNames: true
36+
SortIncludes: true

0 commit comments

Comments
 (0)