From a8cec740f01ea4ec92e8728fcc82c2edb96bd7dd Mon Sep 17 00:00:00 2001 From: dota17 Date: Tue, 10 Mar 2020 15:47:53 +0800 Subject: [PATCH] add options --- .clang-format | 54 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 52 insertions(+), 2 deletions(-) diff --git a/.clang-format b/.clang-format index 3854b3a..d6972be 100644 --- a/.clang-format +++ b/.clang-format @@ -1,3 +1,53 @@ BasedOnStyle: LLVM -DerivePointerAlignment: false -PointerAlignment: Left +# If true, clang-format will attempt to re-flow comments +ReflowComments: false +# The column limit. +ColumnLimit: 100 +# Indent width for line continuations. +ContinuationIndentWidth: 4 +# The number of columns to use for indentation. +IndentWidth: 8 +# The number of columns used for tab stops. +TabWidth: 8 +UseTab: ForIndentation + +# Options for aligning backslashes in escaped newlines. +AlignEscapedNewlines: Left +# Short Block Style +AllowShortBlocksOnASingleLine: true +# If true, short case labels will be contracted to a single line. +AllowShortCaseLabelsOnASingleLine: true +# Dependent on the value, int f() { return 0; } can be put on a single line. +AllowShortFunctionsOnASingleLine: Empty +# The brace breaking style to use. +BreakBeforeBraces: Custom +# Control of individual brace wrapping cases. +BraceWrapping: + # Wrap class definition. + AfterClass: true + # Wrap control statements + AfterControlStatement: true + # Wrap enum definitions. + AfterEnum: true + # Wrap function definitions. + AfterFunction: true + # Wrap namespace definitions. + AfterNamespace: true + # Wrap struct definitions. + AfterStruct: true + # Wrap union definitions. + AfterUnion: true + # Wrap extern blocks. + AfterExternBlock: false + # Wrap before catch. + BeforeCatch: true + # Wrap before else. + BeforeElse: true + # Indent the wrapped braces themselves. + IndentBraces: false + # If false, empty function body can be put on a single line. + SplitEmptyFunction: false + # If false, empty record (e.g. class, struct or union) body can be put on a single line. + SplitEmptyRecord: false + # If false, empty namespace body can be put on a single line. + SplitEmptyNamespace: false -- 2.49.0