blob: f23b842b888f7e252a3414edd3eced05f5f78bdf [file] [log] [blame]
#
# Copyright (C) 2020 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
BasedOnStyle: Google
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
BinPackArguments: true
BinPackParameters: true
ColumnLimit: 100
CommentPragmas: NOLINT:.*
ContinuationIndentWidth: 8
DerivePointerAlignment: false
IndentWidth: 4
PointerAlignment: Left
TabWidth: 4
# Deviations from the above file:
# "Don't indent the section label"
AccessModifierOffset: -4
# "Each line of text in your code should be at most 100 columns long."
ColumnLimit: 100
# "Constructor initializer lists can be all on one line or with subsequent
# lines indented eight spaces.". clang-format does not support having the colon
# on the same line as the constructor function name, so this is the best
# approximation of that rule, which makes all entries in the list (except the
# first one) have an eight space indentation.
ConstructorInitializerIndentWidth: 6
# There is nothing in go/droidcppstyle about case labels, but there seems to be
# more code that does not indent the case labels in frameworks/base.
IndentCaseLabels: false
# There have been some bugs in which subsequent formatting operations introduce
# weird comment jumps.
ReflowComments: false
# Android supports C++17 now, but it seems only Cpp11 will work now.
# "Cpp11 is a deprecated alias for Latest" according to
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html
Standard: Cpp11