mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-10 09:32:29 +01:00
Sync clang-format with OpenLoco
- The formatting properties for JavaScript and ObjectiveC have been removed, since "Language: Cpp" is set. - Remove CommentPragmas - its value doen't apply to our coding style. - ForEachMacros have been replaced with entries for our own foreach loops. - Includes age grouped together (unless there's a comment inbetween), with the 'main' include at the top, then local includes "", and finally system includes <>, with an empty line inbetween each group. - Disable bin-packing of function arguments - NamespaceIndentation set to 'None'. - KeepEmptyLinesAtTheStartOfBlocks set to 'false'. - IndentWrappedFunctionNames set to 'true'. - Never allow short functions to be on a single line, and remove unnecessary rule for tab width since we don't use tabs. These changes will need to be synced with OpenLoco.
This commit is contained in:
committed by
Michael Steenbeek
parent
d6fd840d1f
commit
5d102fd40b
113
.clang-format
113
.clang-format
@@ -1,26 +1,97 @@
|
||||
---
|
||||
BasedOnStyle: LLVM
|
||||
AccessModifierOffset: '-4'
|
||||
---
|
||||
Language: Cpp
|
||||
# BasedOnStyle: WebKit
|
||||
AccessModifierOffset: -4
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
AlignConsecutiveAssignments: 'true'
|
||||
AlignConsecutiveDeclarations: 'true'
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
BinPackParameters: 'false'
|
||||
BreakBeforeBraces: Allman
|
||||
ColumnLimit: '128'
|
||||
Cpp11BracedListStyle: 'false'
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Right
|
||||
AlignOperands: false
|
||||
AlignTrailingComments: true
|
||||
AllowAllParametersOfDeclarationOnNextLine: true
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: true
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: false
|
||||
BinPackArguments: false
|
||||
BinPackParameters: false
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: true
|
||||
AfterEnum: true
|
||||
AfterFunction: true
|
||||
AfterNamespace: true
|
||||
AfterStruct: true
|
||||
AfterUnion: true
|
||||
BeforeCatch: true
|
||||
BeforeElse: true
|
||||
IndentBraces: false
|
||||
SplitEmptyFunction: true
|
||||
SplitEmptyRecord: true
|
||||
SplitEmptyNamespace: true
|
||||
BreakBeforeBinaryOperators: All
|
||||
BreakBeforeBraces: Custom
|
||||
BreakBeforeInheritanceComma: false
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializersBeforeComma: false
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
BreakStringLiterals: true
|
||||
ColumnLimit: 128
|
||||
CompactNamespaces: false
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
ContinuationIndentWidth: 4
|
||||
Cpp11BracedListStyle: false
|
||||
DerivePointerAlignment: false
|
||||
DisableFormat: false
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
FixNamespaceComments: true
|
||||
ForEachMacros:
|
||||
- FOR_ALL_PEEPS
|
||||
- FOR_ALL_GUESTS
|
||||
- FOR_ALL_STAFF
|
||||
- FOR_ALL_RIDES
|
||||
IncludeBlocks: 'Regroup'
|
||||
IncludeCategories:
|
||||
- Regex: '^"(\.{1,2}/)*common\.h"$'
|
||||
Priority: -1
|
||||
- Regex: '^<.*>$'
|
||||
- Regex: '^"'
|
||||
Priority: 1
|
||||
- Regex: '^".*"$'
|
||||
- Regex: '^<'
|
||||
Priority: 2
|
||||
IncludeIsMainRegex: 'false'
|
||||
IndentWidth: '4'
|
||||
PointerAlignment: Middle
|
||||
SortIncludes: 'true'
|
||||
Standard: Cpp11
|
||||
TabWidth: '4'
|
||||
|
||||
IndentCaseLabels: true
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MacroBlockBegin: ''
|
||||
MacroBlockEnd: ''
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
PenaltyBreakAssignment: 2
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
PointerAlignment: Left
|
||||
ReflowComments: true
|
||||
SortIncludes: true
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceAfterTemplateKeyword: false
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesBeforeTrailingComments: 1
|
||||
SpacesInAngles: false
|
||||
SpacesInContainerLiterals: true
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
Standard: Cpp11
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user