modify project clang-format to the correct project formatting options

This commit is contained in:
2025-03-21 16:40:11 +01:00
parent 1a47281ac9
commit ed8f781db4

View File

@@ -6,7 +6,7 @@ BasedOnStyle: '' # (LLVM,Google,Chromium,Mozilla,WebKit,Microsoft
Standard: Auto # automatically detect the language version
ColumnLimit: 0 # 0: disable column limit
LineEnding: LF # use LF line endings
UseTab: Neve # (Never,ForIndentation,ForContinuationAndIndentation,Always)
UseTab: Never # (Never,ForIndentation,ForContinuationAndIndentation,Always)
TabWidth: 4 # recommended to set this equal to IndentWidth
IndentWidth: 4 # how wide each indent is
ContinuationIndentWidth: 4 # width for a line continuation
@@ -94,22 +94,14 @@ IncludeIsMainSourceRegex: '' # only [*.{c,cc,cpp,c++,cxx,m,mm}]
IncludeIsMainRegex: '([-_](test|unittest))?$' # regex used for identifying an include as "main", to assign catagory 0
IncludeBlocks: Regroup # (Preserve,Merge,Regroup)
IncludeCategories:
- Regex: '^<ext/.*\.h>'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*\.h>'
- Regex: '^<.*\.h>' # system headers
Priority: 1
SortPriority: 0
CaseSensitive: false
- Regex: '^<.*'
CaseSensitive: true
- Regex: '^".*' # custom headers
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '.*'
Priority: 3
SortPriority: 0
CaseSensitive: false
CaseSensitive: true
# ---------------------------
# macro and language-specific settings
@@ -137,27 +129,27 @@ WhitespaceSensitiveMacros:
# ---------------------------
# additional formatting and sorting details
# ---------------------------
AllowAllArgumentsOnNextLine: true
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
EmptyLineAfterAccessModifier: Never # (Never,Leave,Always)
EmptyLineBeforeAccessModifier: LogicalBlock # (Never,Leave,LogicalBlock,Always)
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true # adds comments at namespace delimiters
MaxEmptyLinesToKeep: 4
MaxEmptyLinesToKeep: 4 # what the maximum amount of empty lines that we're allowed to keep
ReflowComments: true # reflow comment text to match column limits
RemoveBracesLLVM: false
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
RemoveBracesLLVM: false # don't automatically remove braces
SeparateDefinitionBlocks: Leave # (Leave,Always.Never)
ShortNamespaceLines: 1 # how many lines a namespaces can be to be regarded "short"
SortIncludes: CaseSensitive # (Never,CaseSensitive,CaseInsensitive)
SortJavaStaticImport: Before
SortUsingDeclarations: true
SortJavaStaticImport: Before # (After,Before)
SortUsingDeclarations: LexicographicNumeric # (Never,Lexicographic,LexicographicNumeric)
# ---------------------------
# spacing options
# ---------------------------
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
@@ -172,22 +164,26 @@ SpaceBeforeParensOptions:
AfterIfMacros: true
AfterOverloadedOperator: false
BeforeNonEmptyParentheses: false
SpaceAroundPointerQualifiers: Default
SpaceAroundPointerQualifiers: Default # (Default,Before,After,Both) recommend to use Default and let PointerAlignment decide
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpaceInEmptyBlock: true
SpacesInParens: Custom
SpacesInParensOptions:
ExceptDoubleParentheses: false
InConditionalStatements: false
InCStyleCasts: false
Other: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInAngles: Never # (Never,Always,Leave)
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: 1
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
BitFieldColonSpacing: Both
BitFieldColonSpacing: Both # (Both,None,Before,After)
# ---------------------------
# indentation details
@@ -196,54 +192,24 @@ IndentAccessModifiers: false
IndentCaseLabels: false
IndentCaseBlocks: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentExternBlock: AfterExternBlock
IndentRequires: false
IndentExternBlock: AfterExternBlock # (AfterExternBlock,NoIndent,Indent)
IndentRequiresClause: false
IndentPPDirectives: AfterHash # preprocessor indent style (None,AfterHash,BeforeHash)
PPIndentWidth: 1
# ---------------------------
# raw string literal formats
# ---------------------------
RawStringFormats:
- Language: Cpp
Delimiters:
- cc
- CC
- cpp
- Cpp
- CPP
- 'c++'
- 'C++'
CanonicalDelimiter: ''
BasedOnStyle: google
- Language: TextProto
Delimiters:
- pb
- PB
- proto
- PROTO
EnclosingFunctions:
- EqualsProto
- EquivToProto
- PARSE_PARTIAL_TEXT_PROTO
- PARSE_TEST_PROTO
- PARSE_TEXT_PROTO
- ParseTextOrDie
- ParseTextProtoOrDie
- ParseTestProto
- ParsePartialTestProto
CanonicalDelimiter: pb
BasedOnStyle: google
---
# ---------------------------
# JavaScript specific settings
# ---------------------------
Language: JavaScript
JavaScriptQuotes: Double
JavaScriptWrapImports: true
---
# ---------------------------
# Objective-C specific settings
# ---------------------------
Language: ObjC
ObjCBinPackProtocolList: Never
ObjCBlockIndentWidth: 4
ObjCBreakBeforeNestedBlockParam: true