Jamie Madill | 2fdd3da | 2015-07-20 10:14:54 -0400 | [diff] [blame] | 1 | # Defines the ANGLE style for automatic reformatting. |
| 2 | # https://code.google.com/p/angleproject/wiki/CodingStandard |
| 3 | # See Clang docs: http://clang.llvm.org/docs/ClangFormatStyleOptions.html |
| 4 | BasedOnStyle: Chromium |
| 5 | |
| 6 | # Allow double brackets such as std::vector<std::vector<int>>. |
| 7 | Standard: Cpp11 |
| 8 | |
| 9 | # Indent 4 spaces at a time. |
| 10 | IndentWidth: 4 |
| 11 | |
| 12 | # Keep lines under 100 columns long. |
| 13 | ColumnLimit: 100 |
| 14 | |
| 15 | # Always break before braces |
Jamie Madill | 7fa8824 | 2018-11-26 13:22:57 -0500 | [diff] [blame] | 16 | BreakBeforeBraces: Custom |
| 17 | BraceWrapping: |
Jiacheng Lu | f35f111 | 2019-07-19 09:18:55 -0600 | [diff] [blame] | 18 | # TODO(lujc) wait for clang-format-9 support in Chromium tools |
| 19 | # AfterCaseLabel: true |
Jamie Madill | 7fa8824 | 2018-11-26 13:22:57 -0500 | [diff] [blame] | 20 | AfterClass: true |
| 21 | AfterControlStatement: true |
| 22 | AfterEnum: true |
| 23 | AfterFunction: true |
| 24 | AfterNamespace: true |
| 25 | AfterStruct: true |
| 26 | AfterUnion: true |
| 27 | BeforeCatch: true |
| 28 | BeforeElse: true |
| 29 | IndentBraces: false |
| 30 | SplitEmptyFunction: false |
| 31 | SplitEmptyRecord: false |
| 32 | SplitEmptyNamespace: false |
| 33 | |
| 34 | # Keeps extern "C" blocks unindented. |
| 35 | AfterExternBlock: false |
Jamie Madill | 2fdd3da | 2015-07-20 10:14:54 -0400 | [diff] [blame] | 36 | |
| 37 | # Indent case labels. |
| 38 | IndentCaseLabels: true |
| 39 | |
| 40 | # Right-align pointers and references |
| 41 | PointerAlignment: Right |
| 42 | |
| 43 | # ANGLE likes to align things as much as possible. |
| 44 | AlignOperands: true |
| 45 | AlignConsecutiveAssignments: true |
| 46 | |
| 47 | # Use 2 space negative offset for access modifiers |
| 48 | AccessModifierOffset: -2 |
| 49 | |
| 50 | # TODO(jmadill): Decide if we want this on. Doesn't have an "all or none" mode. |
| 51 | AllowShortCaseLabelsOnASingleLine: false |
Jamie Madill | 2e5797e | 2015-07-29 16:20:28 -0400 | [diff] [blame] | 52 | |
| 53 | # Useful for spacing out functions in classes |
| 54 | KeepEmptyLinesAtTheStartOfBlocks: true |
Jamie Madill | 7fa8824 | 2018-11-26 13:22:57 -0500 | [diff] [blame] | 55 | |
| 56 | # Indent nested PP directives. |
| 57 | IndentPPDirectives: AfterHash |
Jiacheng Lu | f35f111 | 2019-07-19 09:18:55 -0600 | [diff] [blame] | 58 | |
| 59 | # Include blocks style |
| 60 | IncludeBlocks: Preserve |