diff options
author | Iikka Eklund <iikka.eklund@qt.io> | 2024-04-09 15:12:57 +0300 |
---|---|---|
committer | Iikka Eklund <iikka.eklund@qt.io> | 2024-04-10 11:30:56 +0300 |
commit | f6f93c742a6d474cc9adb2523a818534c2c72c56 (patch) | |
tree | 61dd0fead36fc9622953e898e60bd203053f4884 | |
parent | 68ab22aebe9c7b1403d5f13a7becb9afebcf1049 (diff) |
Add .clang-format template
Adopted from Qt Creator project with minor modifications. Qt specific
rules not needed.
https://github.com/qt-creator/qt-creator/blob/master/.clang-format
Pick-to: 3.0
Change-Id: Ia4433888f2dc4d52ff80c59629219779c90322b4
Reviewed-by: Arttu Tarkiainen <arttu.tarkiainen@qt.io>
-rw-r--r-- | .clang-format | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..9bbfbfa --- /dev/null +++ b/.clang-format @@ -0,0 +1,103 @@ +# .clang-format for License Service +# +# This is for clang-format >= 5.0. +# +# The configuration below is adopted from: https://github.com/qt-creator/qt-creator/blob/master/.clang-format +# +# +# [1] https://clang.llvm.org/docs/ClangFormatStyleOptions.html +# +# yaml-language-server: $schema=https://json.schemastore.org/clang-format.json +# +--- +Language: Cpp +AccessModifierOffset: -4 +AlignAfterOpenBracket: AlwaysBreak +AlignConsecutiveAssignments: None +AlignConsecutiveDeclarations: None +AlignEscapedNewlines: DontAlign +AlignOperands: Align +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Never +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Inline +AllowShortIfStatementsOnASingleLine: Never +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BraceWrapping: + AfterClass: true + AfterControlStatement: Never + AfterEnum: false + AfterFunction: true + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: true + AfterUnion: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBinaryOperators: All +BreakBeforeBraces: Custom +BreakBeforeInheritanceComma: false +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeComma +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 100 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: false +IndentWidth: 4 +IndentWrappedFunctionNames: false +InsertBraces: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +ObjCBlockIndentWidth: 4 +ObjCSpaceAfterProperty: false +ObjCSpaceBeforeProtocolList: true +PenaltyBreakAssignment: 88 +PenaltyBreakBeforeFirstCallParameter: 300 +PenaltyBreakComment: 500 +PenaltyBreakFirstLessLess: 400 +PenaltyBreakString: 600 +PenaltyExcessCharacter: 50 +PenaltyReturnTypeOnItsOwnLine: 300 +PointerAlignment: Right +ReflowComments: false +SortIncludes: CaseSensitive +SortUsingDeclarations: true +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeParens: ControlStatements +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: Never +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: c++11 +TabWidth: 4 +UseTab: Never |