Commit e64eb236 authored by David Flynn's avatar David Flynn
Browse files

style: update clang-format definitions

parent 147999ff
##
# clang-format-6.0 format rules
# -- commented out options are supported in 7.0
#
# .clang-format
#
# The copyright in this software is being made available under the BSD
# License, included below. This software may be subject to other third party
# and contributor rights, including patent rights, and no such rights are
# granted under this license.
#
# <OWNER> = Apple Inc.
# <ORGANIZATION> = Apple Inc.
# <YEAR> = 2017
BasedOnStyle: LLVM
IndentWidth: 2
# While a wider limit would be nice, 79 works with diffs in a terminal
ColumnLimit: 79
---
Language: Cpp
Standard: Cpp11
##
# Indentation width related options
#
# Copyright (c) 2017, Apple Inc.
# All rights reserved.
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
MaxEmptyLinesToKeep: 1
SpacesBeforeTrailingComments: 2
TabWidth: 2
UseTab: Never
##
# Breaking lines
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
AlignAfterOpenBracket: AlwaysBreak
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: TopLevelDefinitions
AlwaysBreakBeforeMultilineStrings: true
# NB: change to MultiLine in 7.0
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: true
AfterFunction: true
AfterNamespace: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: true
BeforeElse: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeComma
BreakBeforeInheritanceComma: true
#BreakInheritanceList: BeforeComma
BreakStringLiterals: true
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
#ExperimentalAutoDetectBinPacking: true
##
# Whitespace placement
#
# * Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
# * Neither the name of the <ORGANIZATION> nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
# Don't align assignments, it can create lots of noise in diffs.
# -- but do align comments for readability
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: false
AlignTrailingComments: true
Cpp11BracedListStyle: true
IndentCaseLabels: false
IndentPPDirectives: AfterHash
IndentWrappedFunctionNames: false
KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: Inner
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
#SpaceBeforeCpp11BracedList: true
#SpaceBeforeCtorInitializerColon: true
#SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
#SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInCStyleCastParentheses: false
SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
##
# Misc
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
BasedOnStyle: Google # Use the Google C++ style as the base for our format
---
Language: Cpp
ColumnLimit: 100 # Set column limit to 100
DerivePointerAlignment: false # Don't attempt to detect pointer alignment from file
PointerAlignment: Right # foo &bar;
SortIncludes: false # Sorting includes is currently causing builds to break
...
DerivePointerAlignment: false
FixNamespaceComments: true
IncludeBlocks: Preserve
PointerAlignment: Left
ReflowComments: false
SortIncludes: false
SortUsingDeclarations: true
---
# Don't apply project formatting to bundled third party dependencies
DisableFormat: true
SortIncludes: false
  • I like this very nice post here you can need to connecting the online here free vbucks online here game if you like create some action so join it hurry.

Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment