Skip to content

Commit f56f25a

Browse files
authored
Import .clang-format from InfiniTime and format sources (#191)
This should be a non-change from a compiler's perspective.
1 parent 646a9b7 commit f56f25a

34 files changed

Lines changed: 2745 additions & 2582 deletions

.clang-format

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
---
2+
Language: Cpp
3+
AccessModifierOffset: -2
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveMacros: true
6+
AlignConsecutiveAssignments: false
7+
AlignConsecutiveDeclarations: false
8+
AlignEscapedNewlines: Right
9+
AlignOperands: Align
10+
AlignTrailingComments: true
11+
AllowAllArgumentsOnNextLine: false
12+
AllowAllConstructorInitializersOnNextLine: true
13+
AllowAllParametersOfDeclarationOnNextLine: false
14+
AllowShortBlocksOnASingleLine: Never
15+
AllowShortCaseLabelsOnASingleLine: false
16+
AllowShortFunctionsOnASingleLine: None
17+
AllowShortLambdasOnASingleLine: None
18+
AllowShortIfStatementsOnASingleLine: Never
19+
AllowShortLoopsOnASingleLine: false
20+
AlwaysBreakAfterDefinitionReturnType: None
21+
AlwaysBreakAfterReturnType: None
22+
AlwaysBreakBeforeMultilineStrings: false
23+
AlwaysBreakTemplateDeclarations: Yes
24+
BinPackArguments: false
25+
BinPackParameters: false
26+
BraceWrapping:
27+
AfterCaseLabel: false
28+
AfterClass: false
29+
AfterControlStatement: false
30+
AfterEnum: false
31+
AfterFunction: false
32+
AfterNamespace: false
33+
AfterObjCDeclaration: false
34+
AfterStruct: false
35+
AfterUnion: false
36+
AfterExternBlock: false
37+
BeforeCatch: false
38+
BeforeElse: false
39+
IndentBraces: true
40+
SplitEmptyFunction: true
41+
SplitEmptyRecord: true
42+
SplitEmptyNamespace: true
43+
BreakBeforeBinaryOperators: None
44+
BreakBeforeBraces: Attach
45+
BreakBeforeInheritanceComma: false
46+
BreakInheritanceList: BeforeColon
47+
BreakBeforeTernaryOperators: true
48+
BreakConstructorInitializersBeforeComma: false
49+
BreakConstructorInitializers: BeforeColon
50+
BreakAfterJavaFieldAnnotations: false
51+
BreakStringLiterals: true
52+
ColumnLimit: 140
53+
CommentPragmas: '^ IWYU pragma:'
54+
CompactNamespaces: false
55+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
56+
ConstructorInitializerIndentWidth: 2
57+
ContinuationIndentWidth: 2
58+
Cpp11BracedListStyle: true
59+
DeriveLineEnding: false
60+
DerivePointerAlignment: false
61+
DisableFormat: false
62+
EmptyLineAfterAccessModifier: Never
63+
EmptyLineBeforeAccessModifier: LogicalBlock
64+
ExperimentalAutoDetectBinPacking: true
65+
FixNamespaceComments: false
66+
ForEachMacros:
67+
- foreach
68+
- Q_FOREACH
69+
- BOOST_FOREACH
70+
IncludeBlocks: Preserve
71+
IncludeCategories:
72+
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
73+
Priority: 2
74+
SortPriority: 0
75+
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
76+
Priority: 3
77+
SortPriority: 0
78+
- Regex: '.*'
79+
Priority: 1
80+
SortPriority: 0
81+
IncludeIsMainRegex: '(Test)?$'
82+
IncludeIsMainSourceRegex: ''
83+
IndentAccessModifiers: false
84+
IndentCaseLabels: true
85+
IndentGotoLabels: true
86+
IndentPPDirectives: BeforeHash
87+
IndentWidth: 2
88+
IndentWrappedFunctionNames: false
89+
# Requires Clang >= 15, could also cause incorrect code formatting:
90+
# InsertBraces: true
91+
JavaScriptQuotes: Leave
92+
JavaScriptWrapImports: true
93+
KeepEmptyLinesAtTheStartOfBlocks: true
94+
MacroBlockBegin: ''
95+
MacroBlockEnd: ''
96+
MaxEmptyLinesToKeep: 1
97+
NamespaceIndentation: All
98+
PackConstructorInitializers: NextLine
99+
PenaltyBreakAssignment: 2
100+
PenaltyBreakBeforeFirstCallParameter: 19
101+
PenaltyBreakComment: 300
102+
PenaltyBreakFirstLessLess: 120
103+
PenaltyBreakString: 1000
104+
PenaltyBreakTemplateDeclaration: 10
105+
PenaltyExcessCharacter: 1000000
106+
PenaltyReturnTypeOnItsOwnLine: 60
107+
PointerAlignment: Left
108+
ReferenceAlignment: Pointer
109+
ReflowComments: true
110+
SeparateDefinitionBlocks: Always
111+
SortIncludes: false
112+
SortUsingDeclarations: true
113+
SpaceAfterCStyleCast: true
114+
SpaceAfterLogicalNot: false
115+
SpaceAfterTemplateKeyword: true
116+
SpaceBeforeAssignmentOperators: true
117+
SpaceBeforeCaseColon: false
118+
SpaceBeforeCpp11BracedList: true
119+
SpaceBeforeCtorInitializerColon: true
120+
SpaceBeforeInheritanceColon: true
121+
SpaceBeforeParens: ControlStatementsExceptForEachMacros
122+
SpaceBeforeRangeBasedForLoopColon: true
123+
SpaceInEmptyBlock: false
124+
SpaceInEmptyParentheses: false
125+
SpacesBeforeTrailingComments: 1
126+
SpacesInAngles: false
127+
SpacesInConditionalStatement: false
128+
SpacesInContainerLiterals: false
129+
SpacesInCStyleCastParentheses: false
130+
SpacesInParentheses: false
131+
SpacesInSquareBrackets: false
132+
SpaceBeforeSquareBrackets: false
133+
SpaceAroundPointerQualifiers: Default
134+
Standard: Latest
135+
StatementMacros:
136+
- Q_UNUSED
137+
- QT_REQUIRE_VERSION
138+
TabWidth: 8
139+
UseCRLF: false
140+
UseTab: Never
141+
...

.clang-format-ignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
sim/timers.h
2+
sim/task.cpp
3+
sim/task.h
4+
sim/projdefs.h
5+
sim/portmacro_cmsis.h
6+
sim/FreeRTOS.h
7+
sim/nrfx/**
8+
sim/libraries/**
9+
sim/host/**
10+
gif-h/**
11+
external/**
12+
InfiniTime/**
13+
lv_drivers/**

0 commit comments

Comments
 (0)