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: |
Jamie Madill | 1f9e2a8 | 2020-04-28 10:04:04 -0400 | [diff] [blame] | 18 | AfterCaseLabel: true |
Jamie Madill | 7fa8824 | 2018-11-26 13:22:57 -0500 | [diff] [blame] | 19 | AfterClass: true |
| 20 | AfterControlStatement: true |
| 21 | AfterEnum: true |
| 22 | AfterFunction: true |
| 23 | AfterNamespace: true |
| 24 | AfterStruct: true |
| 25 | AfterUnion: true |
| 26 | BeforeCatch: true |
| 27 | BeforeElse: true |
| 28 | IndentBraces: false |
| 29 | SplitEmptyFunction: false |
| 30 | SplitEmptyRecord: false |
| 31 | SplitEmptyNamespace: false |
| 32 | |
| 33 | # Keeps extern "C" blocks unindented. |
| 34 | AfterExternBlock: false |
Jamie Madill | 2fdd3da | 2015-07-20 10:14:54 -0400 | [diff] [blame] | 35 | |
| 36 | # Indent case labels. |
| 37 | IndentCaseLabels: true |
| 38 | |
| 39 | # Right-align pointers and references |
| 40 | PointerAlignment: Right |
| 41 | |
| 42 | # ANGLE likes to align things as much as possible. |
| 43 | AlignOperands: true |
| 44 | AlignConsecutiveAssignments: true |
| 45 | |
| 46 | # Use 2 space negative offset for access modifiers |
| 47 | AccessModifierOffset: -2 |
| 48 | |
| 49 | # TODO(jmadill): Decide if we want this on. Doesn't have an "all or none" mode. |
| 50 | AllowShortCaseLabelsOnASingleLine: false |
Jamie Madill | 2e5797e | 2015-07-29 16:20:28 -0400 | [diff] [blame] | 51 | |
| 52 | # Useful for spacing out functions in classes |
| 53 | KeepEmptyLinesAtTheStartOfBlocks: true |
Jamie Madill | 7fa8824 | 2018-11-26 13:22:57 -0500 | [diff] [blame] | 54 | |
| 55 | # Indent nested PP directives. |
| 56 | IndentPPDirectives: AfterHash |
Jiacheng Lu | f35f111 | 2019-07-19 09:18:55 -0600 | [diff] [blame] | 57 | |
| 58 | # Include blocks style |
| 59 | IncludeBlocks: Preserve |