| 1 |
# Note from Sam: this is taken from https://github.com/chromium/chromium/blob/main/.clang-format |
| 2 |
|
| 3 |
# Defines the Chromium style for automatic reformatting. |
| 4 |
# http://clang.llvm.org/docs/ClangFormatStyleOptions.html |
| 5 |
BasedOnStyle: Chromium |
| 6 |
# This defaults to 'Auto'. Explicitly set it for a while, so that |
| 7 |
# 'vector<vector<int> >' in existing files gets formatted to |
| 8 |
# 'vector<vector<int>>'. ('Auto' means that clang-format will only use |
| 9 |
# 'int>>' if the file already contains at least one such instance.) |
| 10 |
Standard: Cpp11 |
| 11 |
|
| 12 |
# Make sure code like: |
| 13 |
# IPC_BEGIN_MESSAGE_MAP() |
| 14 |
# IPC_MESSAGE_HANDLER(WidgetHostViewHost_Update, OnUpdate) |
| 15 |
# IPC_END_MESSAGE_MAP() |
| 16 |
# gets correctly indented. |
| 17 |
MacroBlockBegin: "^\ |
| 18 |
BEGIN_MSG_MAP|\ |
| 19 |
BEGIN_MSG_MAP_EX|\ |
| 20 |
BEGIN_SAFE_MSG_MAP_EX|\ |
| 21 |
CR_BEGIN_MSG_MAP_EX|\ |
| 22 |
IPC_BEGIN_MESSAGE_MAP|\ |
| 23 |
IPC_BEGIN_MESSAGE_MAP_WITH_PARAM|\ |
| 24 |
IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN|\ |
| 25 |
IPC_STRUCT_BEGIN|\ |
| 26 |
IPC_STRUCT_BEGIN_WITH_PARENT|\ |
| 27 |
IPC_STRUCT_TRAITS_BEGIN|\ |
| 28 |
POLPARAMS_BEGIN|\ |
| 29 |
PPAPI_BEGIN_MESSAGE_MAP$" |
| 30 |
MacroBlockEnd: "^\ |
| 31 |
CR_END_MSG_MAP|\ |
| 32 |
END_MSG_MAP|\ |
| 33 |
IPC_END_MESSAGE_MAP|\ |
| 34 |
IPC_PROTOBUF_MESSAGE_TRAITS_END|\ |
| 35 |
IPC_STRUCT_END|\ |
| 36 |
IPC_STRUCT_TRAITS_END|\ |
| 37 |
POLPARAMS_END|\ |
| 38 |
PPAPI_END_MESSAGE_MAP$" |
| 39 |
|
| 40 |
# TODO: Remove this once clang-format r357700 is rolled in. |
| 41 |
JavaImportGroups: ['android', 'androidx', 'com', 'dalvik', 'junit', 'org', 'com.google.android.apps.chrome', 'org.chromium', 'java', 'javax'] |
| 42 |
|
| 43 |
#Sam's addition: |
| 44 |
ColumnLimit: 100 |
| 45 |
BreakBeforeBraces: Stroustrup |