Update .clang-tidy, add .clang-format.
This commit is contained in:
parent
4da6929392
commit
63d2497966
131
.clang-format
Normal file
131
.clang-format
Normal file
|
@ -0,0 +1,131 @@
|
||||||
|
# -*- mode: yaml -*-
|
||||||
|
# Written for clang-format 10.
|
||||||
|
# https://releases.llvm.org/10.0.0/tools/clang/docs/ClangFormatStyleOptions.html
|
||||||
|
---
|
||||||
|
DisableFormat: false
|
||||||
|
Language: Cpp
|
||||||
|
|
||||||
|
AccessModifierOffset: -4
|
||||||
|
AlignAfterOpenBracket: Align
|
||||||
|
AlignConsecutiveAssignments: false
|
||||||
|
# AlignConsecutiveBitFields: false # clang-format 11
|
||||||
|
AlignConsecutiveDeclarations: false
|
||||||
|
AlignConsecutiveMacros: false
|
||||||
|
AlignEscapedNewlines: DontAlign
|
||||||
|
AlignOperands: true # clang-format 11: Align
|
||||||
|
AlignTrailingComments: true
|
||||||
|
AllowAllArgumentsOnNextLine: false
|
||||||
|
AllowAllConstructorInitializersOnNextLine: false
|
||||||
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
|
AllowShortBlocksOnASingleLine: Empty
|
||||||
|
AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
# AllowShortEnumsOnASingleLine: false # clang-format 11
|
||||||
|
AllowShortFunctionsOnASingleLine: Empty
|
||||||
|
AllowShortIfStatementsOnASingleLine: Never
|
||||||
|
AllowShortLambdasOnASingleLine: Inline
|
||||||
|
AllowShortLoopsOnASingleLine: false
|
||||||
|
AlwaysBreakAfterReturnType: None
|
||||||
|
AlwaysBreakBeforeMultilineStrings: false
|
||||||
|
AlwaysBreakTemplateDeclarations: Yes
|
||||||
|
BinPackArguments: true
|
||||||
|
BinPackParameters: true
|
||||||
|
BraceWrapping: # If BreakBeforeBraces is set to Custom.
|
||||||
|
AfterCaseLabel: true
|
||||||
|
AfterClass: true
|
||||||
|
AfterControlStatement: Always
|
||||||
|
AfterEnum: true
|
||||||
|
AfterFunction: true
|
||||||
|
AfterNamespace: true
|
||||||
|
AfterStruct: true
|
||||||
|
AfterUnion: true
|
||||||
|
AfterExternBlock: true
|
||||||
|
BeforeCatch: true
|
||||||
|
BeforeElse: true
|
||||||
|
# BeforeLambdaBody: true # clang-format 11
|
||||||
|
# BeforeWhile: true # clang-format 11
|
||||||
|
IndentBraces: false
|
||||||
|
SplitEmptyFunction: false
|
||||||
|
SplitEmptyRecord: false
|
||||||
|
SplitEmptyNamespace: false
|
||||||
|
BreakBeforeBinaryOperators: NonAssignment
|
||||||
|
BreakBeforeBraces: Custom
|
||||||
|
BreakBeforeTernaryOperators: true
|
||||||
|
BreakConstructorInitializers: BeforeComma
|
||||||
|
BreakInheritanceList: BeforeComma
|
||||||
|
BreakStringLiterals: true
|
||||||
|
ColumnLimit: 80
|
||||||
|
# CommentPragmas: 'regex'
|
||||||
|
CompactNamespaces: false
|
||||||
|
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||||
|
ConstructorInitializerIndentWidth: 4
|
||||||
|
ContinuationIndentWidth: 4
|
||||||
|
Cpp11BracedListStyle: true
|
||||||
|
DeriveLineEnding: true
|
||||||
|
DerivePointerAlignment: false
|
||||||
|
FixNamespaceComments: true
|
||||||
|
ForEachMacros:
|
||||||
|
- FOREACH
|
||||||
|
- RANGES_FOR
|
||||||
|
- Q_FOREACH
|
||||||
|
- BOOST_FOREACH
|
||||||
|
IncludeBlocks: Regroup
|
||||||
|
IncludeCategories: # stdlib headers into own group.
|
||||||
|
- Regex: '^[^\.]+$'
|
||||||
|
Priority: 4
|
||||||
|
# IndentCaseBlocks: false # clang-format 11
|
||||||
|
IndentCaseLabels: false
|
||||||
|
# IndentExternBlock: NoIndent # clang-format 11
|
||||||
|
IndentGotoLabels: false
|
||||||
|
IndentPPDirectives: AfterHash
|
||||||
|
IndentWidth: 4
|
||||||
|
IndentWrappedFunctionNames: false
|
||||||
|
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||||
|
# MacroBlockBegin: 'string'
|
||||||
|
# MacroBlockEnd: 'string'
|
||||||
|
MaxEmptyLinesToKeep: 1
|
||||||
|
NamespaceIndentation: None
|
||||||
|
# NamespaceMacros: 'string'
|
||||||
|
PenaltyBreakAssignment: 250
|
||||||
|
PenaltyBreakBeforeFirstCallParameter: 300
|
||||||
|
# PenaltyBreakComment: 300
|
||||||
|
# PenaltyBreakFirstLessLess: 120
|
||||||
|
# PenaltyBreakString: 1000
|
||||||
|
# PenaltyBreakTemplateDeclaration: 10
|
||||||
|
# PenaltyExcessCharacter: 1000000
|
||||||
|
# PenaltyReturnTypeOnItsOwnLine: 60
|
||||||
|
PointerAlignment: Right
|
||||||
|
# RawStringFormats: # <YAML>
|
||||||
|
ReflowComments: true
|
||||||
|
SortIncludes: true
|
||||||
|
SortUsingDeclarations: true
|
||||||
|
SpaceAfterCStyleCast: false
|
||||||
|
SpaceAfterLogicalNot: false
|
||||||
|
SpaceAfterTemplateKeyword: false
|
||||||
|
SpaceBeforeAssignmentOperators: true
|
||||||
|
SpaceBeforeCpp11BracedList: false
|
||||||
|
SpaceBeforeCtorInitializerColon: true
|
||||||
|
SpaceBeforeInheritanceColon: true
|
||||||
|
SpaceBeforeParens: ControlStatements
|
||||||
|
SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
SpaceBeforeSquareBrackets: false
|
||||||
|
SpaceInEmptyBlock: false
|
||||||
|
SpaceInEmptyParentheses: false
|
||||||
|
SpacesBeforeTrailingComments: 1
|
||||||
|
SpacesInAngles: false
|
||||||
|
SpacesInCStyleCastParentheses: false
|
||||||
|
SpacesInConditionalStatement: false
|
||||||
|
SpacesInContainerLiterals: false
|
||||||
|
SpacesInParentheses: false
|
||||||
|
SpacesInSquareBrackets: false
|
||||||
|
Standard: Auto
|
||||||
|
# StatementMacros:
|
||||||
|
# - Q_UNUSED
|
||||||
|
# - QT_REQUIRE_VERSION
|
||||||
|
TabWidth: 4
|
||||||
|
# TypenameMacros:
|
||||||
|
# - STACK_OF
|
||||||
|
# - LIST
|
||||||
|
UseCRLF: false
|
||||||
|
UseTab: Never
|
||||||
|
# WhitespaceSensitiveMacros: ['string', 'string'] # clang-format 11
|
||||||
|
...
|
|
@ -25,7 +25,8 @@ Checks: '*,
|
||||||
-hicpp-vararg,
|
-hicpp-vararg,
|
||||||
-fuchsia-statically-constructed-objects,
|
-fuchsia-statically-constructed-objects,
|
||||||
-google-readability-todo,
|
-google-readability-todo,
|
||||||
-modernize-use-trailing-return-type'
|
-modernize-use-trailing-return-type,
|
||||||
|
-fuchsia-multiple-inheritance'
|
||||||
CheckOptions: - { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
CheckOptions: - { key: readability-identifier-naming.ClassCase, value: CamelCase }
|
||||||
# Clashes with constant private member prefix. (const int _var;)
|
# Clashes with constant private member prefix. (const int _var;)
|
||||||
# - { key: readability-identifier-naming.ConstantCase, value: lower_case }
|
# - { key: readability-identifier-naming.ConstantCase, value: lower_case }
|
||||||
|
|
Loading…
Reference in New Issue
Block a user