From c37dce644609a3d0b0ea539798a27898adfba90e Mon Sep 17 00:00:00 2001 From: "rick.chan" Date: Mon, 19 Aug 2024 13:31:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20format=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: rick.chan --- .../Clang/Clang_Format_自定义风格.md | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/Software/Applications/Clang/Clang_Format_自定义风格.md b/Software/Applications/Clang/Clang_Format_自定义风格.md index 0187c06..fa62411 100644 --- a/Software/Applications/Clang/Clang_Format_自定义风格.md +++ b/Software/Applications/Clang/Clang_Format_自定义风格.md @@ -410,6 +410,45 @@ TabWidth: 4 UseTab: Never ``` +```yml +--- +# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto +Language: Cpp +BasedOnStyle: LLVM +AccessModifierOffset: '-4' +AlignAfterOpenBracket: Align +AlignEscapedNewlines: Left +AllowShortFunctionsOnASingleLine: Inline +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: None +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Custom +BreakConstructorInitializers: BeforeComma +ColumnLimit: '100' +ConstructorInitializerIndentWidth: '4' +ContinuationIndentWidth: '4' +ForEachMacros: 'foreach,Q_FOREACH,BOOST_FOREACH' +IndentPPDirectives: AfterHash +IndentWidth: '4' +MaxEmptyLinesToKeep: '10' +ObjCBlockIndentWidth: '4' +PenaltyBreakBeforeFirstCallParameter: '2' +PenaltyBreakComment: '300' +PenaltyBreakFirstLessLess: '120' +PenaltyBreakString: '1000' +PenaltyExcessCharacter: '1000000' +PenaltyReturnTypeOnItsOwnLine: '120' +PointerAlignment: Left +SpaceBeforeParens: ControlStatements +SpacesBeforeTrailingComments: '3' +Standard: Cpp11 +TabWidth: '4' +UseTab: ForIndentation + +... + +``` + ## 外部参考资料 1. [Clang 18.0.0git documentation](https://clang.llvm.org/docs/ClangFormatStyleOptions.html)