hkuang | 26587cb | 2020-01-16 10:36:08 -0800 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2020 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | BasedOnStyle: Google |
| 18 | AllowShortFunctionsOnASingleLine: Inline |
| 19 | AllowShortIfStatementsOnASingleLine: true |
| 20 | AllowShortLoopsOnASingleLine: true |
| 21 | BinPackArguments: true |
| 22 | BinPackParameters: true |
| 23 | ColumnLimit: 100 |
| 24 | CommentPragmas: NOLINT:.* |
| 25 | ContinuationIndentWidth: 8 |
| 26 | DerivePointerAlignment: false |
| 27 | IndentWidth: 4 |
| 28 | PointerAlignment: Left |
hkuang | 181f2ec | 2020-04-11 10:24:31 -0700 | [diff] [blame] | 29 | TabWidth: 4 |
| 30 | |
| 31 | # Deviations from the above file: |
| 32 | # "Don't indent the section label" |
| 33 | AccessModifierOffset: -4 |
| 34 | # "Each line of text in your code should be at most 100 columns long." |
| 35 | ColumnLimit: 100 |
| 36 | # "Constructor initializer lists can be all on one line or with subsequent |
| 37 | # lines indented eight spaces.". clang-format does not support having the colon |
| 38 | # on the same line as the constructor function name, so this is the best |
| 39 | # approximation of that rule, which makes all entries in the list (except the |
| 40 | # first one) have an eight space indentation. |
| 41 | ConstructorInitializerIndentWidth: 6 |
| 42 | # There is nothing in go/droidcppstyle about case labels, but there seems to be |
| 43 | # more code that does not indent the case labels in frameworks/base. |
| 44 | IndentCaseLabels: false |
| 45 | # There have been some bugs in which subsequent formatting operations introduce |
| 46 | # weird comment jumps. |
| 47 | ReflowComments: false |
| 48 | # Android supports C++17 now, but it seems only Cpp11 will work now. |
| 49 | # "Cpp11 is a deprecated alias for Latest" according to |
| 50 | # https://clang.llvm.org/docs/ClangFormatStyleOptions.html |
| 51 | Standard: Cpp11 |