mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
CI: Update pre-commit clang-format
to 18.1.8
• Modernized `.clang-format` file against latest LLVM config settings
This commit is contained in:
parent
0a4aedb360
commit
72c183ce8b
311
.clang-format
311
.clang-format
@ -1,29 +1,59 @@
|
|||||||
# Commented out parameters are those with the same value as base LLVM style.
|
# Commented out parameters are those with the same value as base LLVM style.
|
||||||
# We can uncomment them if we want to change their value, or enforce the
|
# We can uncomment them if we want to change their value, or enforce the
|
||||||
# chosen value in case the base style changes (last sync: Clang 14.0).
|
# chosen value in case the base style changes (last sync: Clang 18.1.8).
|
||||||
---
|
BasedOnStyle: LLVM
|
||||||
### General config, applies to all languages ###
|
|
||||||
BasedOnStyle: LLVM
|
|
||||||
AccessModifierOffset: -4
|
AccessModifierOffset: -4
|
||||||
AlignAfterOpenBracket: DontAlign
|
AlignAfterOpenBracket: DontAlign
|
||||||
# AlignArrayOfStructures: None
|
# AlignArrayOfStructures: None
|
||||||
# AlignConsecutiveMacros: None
|
# AlignConsecutiveAssignments:
|
||||||
# AlignConsecutiveAssignments: None
|
# Enabled: false
|
||||||
# AlignConsecutiveBitFields: None
|
# AcrossEmptyLines: false
|
||||||
# AlignConsecutiveDeclarations: None
|
# AcrossComments: false
|
||||||
|
# AlignCompound: false
|
||||||
|
# AlignFunctionPointers: false
|
||||||
|
# PadOperators: true
|
||||||
|
# AlignConsecutiveBitFields:
|
||||||
|
# Enabled: false
|
||||||
|
# AcrossEmptyLines: false
|
||||||
|
# AcrossComments: false
|
||||||
|
# AlignCompound: false
|
||||||
|
# AlignFunctionPointers: false
|
||||||
|
# PadOperators: false
|
||||||
|
# AlignConsecutiveDeclarations:
|
||||||
|
# Enabled: false
|
||||||
|
# AcrossEmptyLines: false
|
||||||
|
# AcrossComments: false
|
||||||
|
# AlignCompound: false
|
||||||
|
# AlignFunctionPointers: false
|
||||||
|
# PadOperators: false
|
||||||
|
# AlignConsecutiveMacros:
|
||||||
|
# Enabled: false
|
||||||
|
# AcrossEmptyLines: false
|
||||||
|
# AcrossComments: false
|
||||||
|
# AlignCompound: false
|
||||||
|
# AlignFunctionPointers: false
|
||||||
|
# PadOperators: false
|
||||||
|
# AlignConsecutiveShortCaseStatements:
|
||||||
|
# Enabled: false
|
||||||
|
# AcrossEmptyLines: false
|
||||||
|
# AcrossComments: false
|
||||||
|
# AlignCaseColons: false
|
||||||
# AlignEscapedNewlines: Right
|
# AlignEscapedNewlines: Right
|
||||||
AlignOperands: DontAlign
|
AlignOperands: DontAlign
|
||||||
AlignTrailingComments: false
|
AlignTrailingComments:
|
||||||
|
Kind: Never
|
||||||
|
OverEmptyLines: 0
|
||||||
# AllowAllArgumentsOnNextLine: true
|
# AllowAllArgumentsOnNextLine: true
|
||||||
AllowAllParametersOfDeclarationOnNextLine: false
|
AllowAllParametersOfDeclarationOnNextLine: false
|
||||||
# AllowShortEnumsOnASingleLine: true
|
# AllowBreakBeforeNoexceptSpecifier: Never
|
||||||
# AllowShortBlocksOnASingleLine: Never
|
# AllowShortBlocksOnASingleLine: Never
|
||||||
# AllowShortCaseLabelsOnASingleLine: false
|
# AllowShortCaseLabelsOnASingleLine: false
|
||||||
|
# AllowShortCompoundRequirementOnASingleLine: true
|
||||||
|
# AllowShortEnumsOnASingleLine: true
|
||||||
# AllowShortFunctionsOnASingleLine: All
|
# AllowShortFunctionsOnASingleLine: All
|
||||||
# AllowShortLambdasOnASingleLine: All
|
|
||||||
# AllowShortIfStatementsOnASingleLine: Never
|
# AllowShortIfStatementsOnASingleLine: Never
|
||||||
|
# AllowShortLambdasOnASingleLine: All
|
||||||
# AllowShortLoopsOnASingleLine: false
|
# AllowShortLoopsOnASingleLine: false
|
||||||
# AlwaysBreakAfterDefinitionReturnType: None
|
|
||||||
# AlwaysBreakAfterReturnType: None
|
# AlwaysBreakAfterReturnType: None
|
||||||
# AlwaysBreakBeforeMultilineStrings: false
|
# AlwaysBreakBeforeMultilineStrings: false
|
||||||
# AlwaysBreakTemplateDeclarations: MultiLine
|
# AlwaysBreakTemplateDeclarations: MultiLine
|
||||||
@ -31,50 +61,49 @@ AllowAllParametersOfDeclarationOnNextLine: false
|
|||||||
# - __capability
|
# - __capability
|
||||||
# BinPackArguments: true
|
# BinPackArguments: true
|
||||||
# BinPackParameters: true
|
# BinPackParameters: true
|
||||||
|
# BitFieldColonSpacing: Both
|
||||||
# BraceWrapping:
|
# BraceWrapping:
|
||||||
# AfterCaseLabel: false
|
# AfterCaseLabel: false
|
||||||
# AfterClass: false
|
# AfterClass: false
|
||||||
# AfterControlStatement: Never
|
# AfterControlStatement: Never
|
||||||
# AfterEnum: false
|
# AfterEnum: false
|
||||||
# AfterFunction: false
|
# AfterFunction: false
|
||||||
# AfterNamespace: false
|
# AfterNamespace: false
|
||||||
# AfterObjCDeclaration: false
|
# AfterObjCDeclaration: false
|
||||||
# AfterStruct: false
|
# AfterStruct: false
|
||||||
# AfterUnion: false
|
# AfterUnion: false
|
||||||
# AfterExternBlock: false
|
# AfterExternBlock: false
|
||||||
# BeforeCatch: false
|
# BeforeCatch: false
|
||||||
# BeforeElse: false
|
# BeforeElse: false
|
||||||
# BeforeLambdaBody: false
|
# BeforeLambdaBody: false
|
||||||
# BeforeWhile: false
|
# BeforeWhile: false
|
||||||
# IndentBraces: false
|
# IndentBraces: false
|
||||||
# SplitEmptyFunction: true
|
# SplitEmptyFunction: true
|
||||||
# SplitEmptyRecord: true
|
# SplitEmptyRecord: true
|
||||||
# SplitEmptyNamespace: true
|
# SplitEmptyNamespace: true
|
||||||
|
# BreakAdjacentStringLiterals: true
|
||||||
|
# BreakAfterAttributes: Leave
|
||||||
|
# BreakAfterJavaFieldAnnotations: false
|
||||||
|
# BreakArrays: true
|
||||||
# BreakBeforeBinaryOperators: None
|
# BreakBeforeBinaryOperators: None
|
||||||
# BreakBeforeConceptDeclarations: true
|
|
||||||
# BreakBeforeBraces: Attach
|
# BreakBeforeBraces: Attach
|
||||||
# BreakBeforeInheritanceComma: false
|
# BreakBeforeConceptDeclarations: Always
|
||||||
# BreakInheritanceList: BeforeColon
|
# BreakBeforeInlineASMColon: OnlyMultiline
|
||||||
# BreakBeforeTernaryOperators: true
|
# BreakBeforeTernaryOperators: true
|
||||||
# BreakConstructorInitializersBeforeComma: false
|
|
||||||
BreakConstructorInitializers: AfterColon
|
BreakConstructorInitializers: AfterColon
|
||||||
|
# BreakInheritanceList: BeforeColon
|
||||||
# BreakStringLiterals: true
|
# BreakStringLiterals: true
|
||||||
ColumnLimit: 0
|
ColumnLimit: 0
|
||||||
# CommentPragmas: '^ IWYU pragma:'
|
# CommentPragmas: '^ IWYU pragma:'
|
||||||
# QualifierAlignment: Leave
|
|
||||||
# CompactNamespaces: false
|
# CompactNamespaces: false
|
||||||
ConstructorInitializerIndentWidth: 8
|
ConstructorInitializerIndentWidth: 8
|
||||||
ContinuationIndentWidth: 8
|
ContinuationIndentWidth: 8
|
||||||
Cpp11BracedListStyle: false
|
Cpp11BracedListStyle: false
|
||||||
# DeriveLineEnding: true
|
|
||||||
# DerivePointerAlignment: false
|
# DerivePointerAlignment: false
|
||||||
# DisableFormat: false
|
# DisableFormat: false
|
||||||
# EmptyLineAfterAccessModifier: Never
|
# EmptyLineAfterAccessModifier: Never
|
||||||
# EmptyLineBeforeAccessModifier: LogicalBlock
|
# EmptyLineBeforeAccessModifier: LogicalBlock
|
||||||
# ExperimentalAutoDetectBinPacking: false
|
# ExperimentalAutoDetectBinPacking: false
|
||||||
# PackConstructorInitializers: BinPack
|
|
||||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|
||||||
# AllowAllConstructorInitializersOnNextLine: true
|
|
||||||
# FixNamespaceComments: true
|
# FixNamespaceComments: true
|
||||||
# ForEachMacros:
|
# ForEachMacros:
|
||||||
# - foreach
|
# - foreach
|
||||||
@ -82,118 +111,138 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
|||||||
# - BOOST_FOREACH
|
# - BOOST_FOREACH
|
||||||
# IfMacros:
|
# IfMacros:
|
||||||
# - KJ_IF_MAYBE
|
# - KJ_IF_MAYBE
|
||||||
# IncludeBlocks: Preserve
|
# IncludeBlocks: Preserve
|
||||||
IncludeCategories:
|
IncludeCategories:
|
||||||
- Regex: '".*"'
|
- Regex: ^".*"$
|
||||||
Priority: 1
|
Priority: 1
|
||||||
- Regex: '^<.*\.h>'
|
- Regex: ^<.*\.h>$
|
||||||
Priority: 2
|
Priority: 2
|
||||||
- Regex: '^<.*'
|
- Regex: ^<.*>$
|
||||||
Priority: 3
|
Priority: 3
|
||||||
# IncludeIsMainRegex: '(Test)?$'
|
# IncludeIsMainRegex: (Test)?$
|
||||||
# IncludeIsMainSourceRegex: ''
|
# IncludeIsMainSourceRegex: ''
|
||||||
# IndentAccessModifiers: false
|
# IndentAccessModifiers: false
|
||||||
IndentCaseLabels: true
|
|
||||||
# IndentCaseBlocks: false
|
# IndentCaseBlocks: false
|
||||||
|
IndentCaseLabels: true
|
||||||
|
# IndentExternBlock: AfterExternBlock
|
||||||
# IndentGotoLabels: true
|
# IndentGotoLabels: true
|
||||||
# IndentPPDirectives: None
|
# IndentPPDirectives: None
|
||||||
# IndentExternBlock: AfterExternBlock
|
# IndentRequiresClause: true
|
||||||
# IndentRequires: false
|
IndentWidth: 4
|
||||||
IndentWidth: 4
|
|
||||||
# IndentWrappedFunctionNames: false
|
# IndentWrappedFunctionNames: false
|
||||||
|
# InsertBraces: false
|
||||||
|
# InsertNewlineAtEOF: false
|
||||||
# InsertTrailingCommas: None
|
# InsertTrailingCommas: None
|
||||||
|
# IntegerLiteralSeparator:
|
||||||
|
# Binary: 0
|
||||||
|
# BinaryMinDigits: 0
|
||||||
|
# Decimal: 0
|
||||||
|
# DecimalMinDigits: 0
|
||||||
|
# Hex: 0
|
||||||
|
# HexMinDigits: 0
|
||||||
|
JavaImportGroups:
|
||||||
|
- org.godotengine
|
||||||
|
- android
|
||||||
|
- androidx
|
||||||
|
- com.android
|
||||||
|
- com.google
|
||||||
|
- java
|
||||||
|
- javax
|
||||||
# JavaScriptQuotes: Leave
|
# JavaScriptQuotes: Leave
|
||||||
# JavaScriptWrapImports: true
|
# JavaScriptWrapImports: true
|
||||||
|
# KeepEmptyLinesAtEOF: false
|
||||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||||
# LambdaBodyIndentation: Signature
|
# LambdaBodyIndentation: Signature
|
||||||
|
# Language: Cpp
|
||||||
|
# LineEnding: DeriveLF
|
||||||
# MacroBlockBegin: ''
|
# MacroBlockBegin: ''
|
||||||
# MacroBlockEnd: ''
|
# MacroBlockEnd: ''
|
||||||
# MaxEmptyLinesToKeep: 1
|
# MaxEmptyLinesToKeep: 1
|
||||||
# NamespaceIndentation: None
|
# NamespaceIndentation: None
|
||||||
# PenaltyBreakAssignment: 2
|
|
||||||
# PenaltyBreakBeforeFirstCallParameter: 19
|
|
||||||
# PenaltyBreakComment: 300
|
|
||||||
# PenaltyBreakFirstLessLess: 120
|
|
||||||
# PenaltyBreakOpenParenthesis: 0
|
|
||||||
# PenaltyBreakString: 1000
|
|
||||||
# PenaltyBreakTemplateDeclaration: 10
|
|
||||||
# PenaltyExcessCharacter: 1000000
|
|
||||||
# PenaltyReturnTypeOnItsOwnLine: 60
|
|
||||||
# PenaltyIndentedWhitespace: 0
|
|
||||||
# PointerAlignment: Right
|
|
||||||
# PPIndentWidth: -1
|
|
||||||
# ReferenceAlignment: Pointer
|
|
||||||
# ReflowComments: true
|
|
||||||
# RemoveBracesLLVM: false
|
|
||||||
# SeparateDefinitionBlocks: Leave
|
|
||||||
# ShortNamespaceLines: 1
|
|
||||||
# SortIncludes: CaseSensitive
|
|
||||||
# SortJavaStaticImport: Before
|
|
||||||
# SortUsingDeclarations: true
|
|
||||||
# SpaceAfterCStyleCast: false
|
|
||||||
# SpaceAfterLogicalNot: false
|
|
||||||
# SpaceAfterTemplateKeyword: true
|
|
||||||
# SpaceBeforeAssignmentOperators: true
|
|
||||||
# SpaceBeforeCaseColon: false
|
|
||||||
# SpaceBeforeCpp11BracedList: false
|
|
||||||
# SpaceBeforeCtorInitializerColon: true
|
|
||||||
# SpaceBeforeInheritanceColon: true
|
|
||||||
# SpaceBeforeParens: ControlStatements
|
|
||||||
# SpaceBeforeParensOptions:
|
|
||||||
# AfterControlStatements: true
|
|
||||||
# AfterForeachMacros: true
|
|
||||||
# AfterFunctionDefinitionName: false
|
|
||||||
# AfterFunctionDeclarationName: false
|
|
||||||
# AfterIfMacros: true
|
|
||||||
# AfterOverloadedOperator: false
|
|
||||||
# BeforeNonEmptyParentheses: false
|
|
||||||
# SpaceAroundPointerQualifiers: Default
|
|
||||||
# SpaceBeforeRangeBasedForLoopColon: true
|
|
||||||
# SpaceInEmptyBlock: false
|
|
||||||
# SpaceInEmptyParentheses: false
|
|
||||||
# SpacesBeforeTrailingComments: 1
|
|
||||||
# SpacesInAngles: Never
|
|
||||||
# SpacesInConditionalStatement: false
|
|
||||||
# SpacesInContainerLiterals: true
|
|
||||||
# SpacesInCStyleCastParentheses: false
|
|
||||||
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
|
|
||||||
## our comment capitalization at the same time.
|
|
||||||
SpacesInLineCommentPrefix:
|
|
||||||
Minimum: 0
|
|
||||||
Maximum: -1
|
|
||||||
# SpacesInParentheses: false
|
|
||||||
# SpacesInSquareBrackets: false
|
|
||||||
# SpaceBeforeSquareBrackets: false
|
|
||||||
# BitFieldColonSpacing: Both
|
|
||||||
# StatementAttributeLikeMacros:
|
|
||||||
# - Q_EMIT
|
|
||||||
# StatementMacros:
|
|
||||||
# - Q_UNUSED
|
|
||||||
# - QT_REQUIRE_VERSION
|
|
||||||
TabWidth: 4
|
|
||||||
# UseCRLF: false
|
|
||||||
UseTab: Always
|
|
||||||
# WhitespaceSensitiveMacros:
|
|
||||||
# - STRINGIZE
|
|
||||||
# - PP_STRINGIZE
|
|
||||||
# - BOOST_PP_STRINGIZE
|
|
||||||
# - NS_SWIFT_NAME
|
|
||||||
# - CF_SWIFT_NAME
|
|
||||||
---
|
|
||||||
### C++ specific config ###
|
|
||||||
Language: Cpp
|
|
||||||
Standard: c++17
|
|
||||||
---
|
|
||||||
### ObjC specific config ###
|
|
||||||
Language: ObjC
|
|
||||||
# ObjCBinPackProtocolList: Auto
|
# ObjCBinPackProtocolList: Auto
|
||||||
ObjCBlockIndentWidth: 4
|
ObjCBlockIndentWidth: 4
|
||||||
# ObjCBreakBeforeNestedBlockParam: true
|
# ObjCBreakBeforeNestedBlockParam: true
|
||||||
# ObjCSpaceAfterProperty: false
|
# ObjCSpaceAfterProperty: false
|
||||||
# ObjCSpaceBeforeProtocolList: true
|
# ObjCSpaceBeforeProtocolList: true
|
||||||
---
|
# PPIndentWidth: -1
|
||||||
### Java specific config ###
|
PackConstructorInitializers: NextLine
|
||||||
Language: Java
|
# PenaltyBreakAssignment: 2
|
||||||
# BreakAfterJavaFieldAnnotations: false
|
# PenaltyBreakBeforeFirstCallParameter: 19
|
||||||
JavaImportGroups: ['org.godotengine', 'android', 'androidx', 'com.android', 'com.google', 'java', 'javax']
|
# PenaltyBreakComment: 300
|
||||||
...
|
# PenaltyBreakFirstLessLess: 120
|
||||||
|
# PenaltyBreakOpenParenthesis: 0
|
||||||
|
# PenaltyBreakScopeResolution: 500
|
||||||
|
# PenaltyBreakString: 1000
|
||||||
|
# PenaltyBreakTemplateDeclaration: 10
|
||||||
|
# PenaltyExcessCharacter: 1000000
|
||||||
|
# PenaltyIndentedWhitespace: 0
|
||||||
|
# PenaltyReturnTypeOnItsOwnLine: 60
|
||||||
|
# PointerAlignment: Right
|
||||||
|
# QualifierAlignment: Leave
|
||||||
|
# ReferenceAlignment: Pointer
|
||||||
|
# ReflowComments: true
|
||||||
|
# RemoveBracesLLVM: false
|
||||||
|
# RemoveParentheses: Leave
|
||||||
|
# RemoveSemicolon: false
|
||||||
|
# RequiresClausePosition: OwnLine
|
||||||
|
# RequiresExpressionIndentation: OuterScope
|
||||||
|
# SeparateDefinitionBlocks: Leave
|
||||||
|
# ShortNamespaceLines: 1
|
||||||
|
# SkipMacroDefinitionBody: false
|
||||||
|
# SortIncludes: CaseSensitive
|
||||||
|
# SortJavaStaticImport: Before
|
||||||
|
# SortUsingDeclarations: LexicographicNumeric
|
||||||
|
# SpaceAfterCStyleCast: false
|
||||||
|
# SpaceAfterLogicalNot: false
|
||||||
|
# SpaceAfterTemplateKeyword: true
|
||||||
|
# SpaceAroundPointerQualifiers: Default
|
||||||
|
# SpaceBeforeAssignmentOperators: true
|
||||||
|
# SpaceBeforeCaseColon: false
|
||||||
|
# SpaceBeforeCpp11BracedList: false
|
||||||
|
# SpaceBeforeCtorInitializerColon: true
|
||||||
|
# SpaceBeforeInheritanceColon: true
|
||||||
|
# SpaceBeforeJsonColon: false
|
||||||
|
# SpaceBeforeParensOptions:
|
||||||
|
# AfterControlStatements: true
|
||||||
|
# AfterForeachMacros: true
|
||||||
|
# AfterFunctionDeclarationName: false
|
||||||
|
# AfterFunctionDefinitionName: false
|
||||||
|
# AfterIfMacros: true
|
||||||
|
# AfterOverloadedOperator: false
|
||||||
|
# AfterPlacementOperator: true
|
||||||
|
# AfterRequiresInClause: false
|
||||||
|
# AfterRequiresInExpression: false
|
||||||
|
# BeforeNonEmptyParentheses: false
|
||||||
|
# SpaceBeforeRangeBasedForLoopColon: true
|
||||||
|
# SpaceBeforeSquareBrackets: false
|
||||||
|
# SpaceInEmptyBlock: false
|
||||||
|
# SpacesBeforeTrailingComments: 1
|
||||||
|
# SpacesInAngles: Never
|
||||||
|
# SpacesInContainerLiterals: true
|
||||||
|
## Godot TODO: We'll want to use a min of 1, but we need to see how to fix
|
||||||
|
## our comment capitalization at the same time.
|
||||||
|
SpacesInLineCommentPrefix:
|
||||||
|
Minimum: 0
|
||||||
|
Maximum: -1
|
||||||
|
# SpacesInParens: Never
|
||||||
|
# SpacesInParensOptions:
|
||||||
|
# InConditionalStatements: false
|
||||||
|
# InCStyleCasts: false
|
||||||
|
# InEmptyParentheses: false
|
||||||
|
# Other: false
|
||||||
|
# SpacesInSquareBrackets: false
|
||||||
|
Standard: c++17
|
||||||
|
# StatementAttributeLikeMacros:
|
||||||
|
# - Q_EMIT
|
||||||
|
# StatementMacros:
|
||||||
|
# - Q_UNUSED
|
||||||
|
# - QT_REQUIRE_VERSION
|
||||||
|
TabWidth: 4
|
||||||
|
UseTab: Always
|
||||||
|
# VerilogBreakBetweenInstancePorts: true
|
||||||
|
# WhitespaceSensitiveMacros:
|
||||||
|
# - BOOST_PP_STRINGIZE
|
||||||
|
# - CF_SWIFT_NAME
|
||||||
|
# - NS_SWIFT_NAME
|
||||||
|
# - PP_STRINGIZE
|
||||||
|
# - STRINGIZE
|
||||||
|
@ -9,7 +9,7 @@ exclude: |
|
|||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
rev: v17.0.6
|
rev: v18.1.8
|
||||||
hooks:
|
hooks:
|
||||||
- id: clang-format
|
- id: clang-format
|
||||||
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$
|
files: \.(c|h|cpp|hpp|cc|hh|cxx|hxx|m|mm|inc|java|glsl)$
|
||||||
|
Loading…
Reference in New Issue
Block a user