Skip to content

Commit 980c27c

Browse files
committed
Add a clang-format since I can't specify one globally
1 parent 062e904 commit 980c27c

File tree

2 files changed

+87
-2
lines changed

2 files changed

+87
-2
lines changed

.clang-format

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# https://forum.juce.com/t/automatic-juce-like-code-formatting-with-clang-format/31624/20
2+
---
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: DontAlign
5+
AlignConsecutiveAssignments: false
6+
AlignConsecutiveDeclarations: false
7+
AlignEscapedNewlines: Left
8+
AlignOperands: Align
9+
AlignTrailingComments: false
10+
AllowAllParametersOfDeclarationOnNextLine: false
11+
AllowShortBlocksOnASingleLine: Never
12+
AllowShortCaseLabelsOnASingleLine: false
13+
AllowShortFunctionsOnASingleLine: All
14+
AllowShortIfStatementsOnASingleLine: Never
15+
AllowShortLambdasOnASingleLine: All
16+
AllowShortLoopsOnASingleLine: false
17+
AlwaysBreakAfterDefinitionReturnType: None
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakBeforeMultilineStrings: false
20+
AlwaysBreakTemplateDeclarations: Yes
21+
BinPackArguments: false
22+
BinPackParameters: false
23+
BreakAfterJavaFieldAnnotations: false
24+
BreakBeforeBinaryOperators: NonAssignment
25+
BreakBeforeBraces: Custom
26+
BraceWrapping: # Allman except for lambdas
27+
AfterClass: true
28+
AfterCaseLabel: true
29+
AfterFunction: true
30+
AfterNamespace: true
31+
AfterStruct: true
32+
BeforeElse: true
33+
AfterControlStatement: Always
34+
BeforeLambdaBody: false
35+
BreakBeforeTernaryOperators: true
36+
BreakConstructorInitializersBeforeComma: false
37+
BreakStringLiterals: false
38+
ColumnLimit: 0
39+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
40+
ConstructorInitializerIndentWidth: 4
41+
ContinuationIndentWidth: 4
42+
Cpp11BracedListStyle: false
43+
DerivePointerAlignment: false
44+
DisableFormat: false
45+
ExperimentalAutoDetectBinPacking: false
46+
IndentCaseLabels: true
47+
IndentPPDirectives: BeforeHash
48+
IndentWidth: 4
49+
IndentWrappedFunctionNames: true
50+
KeepEmptyLinesAtTheStartOfBlocks: false
51+
Language: Cpp
52+
MaxEmptyLinesToKeep: 1
53+
FixNamespaceComments: false
54+
NamespaceIndentation: All
55+
PointerAlignment: Left
56+
ReflowComments: false
57+
SortIncludes: true
58+
SpaceAfterCStyleCast: true
59+
SpaceAfterLogicalNot: false
60+
SpaceBeforeAssignmentOperators: true
61+
SpaceBeforeCpp11BracedList: true
62+
SpaceBeforeParens: NonEmptyParentheses
63+
SpaceInEmptyParentheses: false
64+
SpaceBeforeInheritanceColon: true
65+
SpacesInAngles: false
66+
SpacesInCStyleCastParentheses: false
67+
SpacesInContainerLiterals: true
68+
SpacesInParentheses: false
69+
SpacesInSquareBrackets: false
70+
Standard: "c++20"
71+
TabWidth: 4
72+
UseTab: Never
73+
UseCRLF: false
74+
---
75+
Language: ObjC
76+
BasedOnStyle: Chromium
77+
BreakBeforeBraces: Allman
78+
ColumnLimit: 0
79+
IndentWidth: 4
80+
KeepEmptyLinesAtTheStartOfBlocks: false
81+
ObjCSpaceAfterProperty: true
82+
ObjCSpaceBeforeProtocolList: true
83+
PointerAlignment: Left
84+
SpacesBeforeTrailingComments: 1
85+
TabWidth: 4
86+
UseTab: Never

CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -156,5 +156,4 @@ target_link_libraries(Tests PRIVATE Catch2::Catch2WithMain "${PROJECT_NAME}" ${J
156156
set_target_properties(Tests PROPERTIES XCODE_GENERATE_SCHEME ON)
157157

158158
# Organize the test source in the Tests/ folder in the IDE
159-
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Tests PREFIX "" FILES ${TestFiles})
160-
159+
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/Tests PREFIX "" FILES ${TestFiles})

0 commit comments

Comments
 (0)