Skip to content

Commit af6f021

Browse files
David Williams-Younglicense[bot]Clang Robot
authored
Add Clang-Format GH Action (#14)
* Add clang-format * Add clang-lint GH Action * typo * Committing license headers * Edits to Clang-Format action * Bump linter action version * Bump linter action version * Variables in linter action * Variables in linter action * Variables in linter action * Variables in linter action * Committing clang-format changes --------- Co-authored-by: license[bot] <license[bot]@github.com> Co-authored-by: Clang Robot <[email protected]>
1 parent f8695b7 commit af6f021

File tree

139 files changed

+8737
-10177
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

139 files changed

+8737
-10177
lines changed

.clang-format

+246
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
# MACIS Copyright (c) 2023, The Regents of the University of California,
2+
# through Lawrence Berkeley National Laboratory (subject to receipt of
3+
# any required approvals from the U.S. Dept. of Energy). All rights reserved.
4+
#
5+
# See LICENSE.txt for details
6+
7+
---
8+
Language: Cpp
9+
# BasedOnStyle: Google
10+
AccessModifierOffset: -1
11+
AlignAfterOpenBracket: Align
12+
AlignArrayOfStructures: None
13+
AlignConsecutiveAssignments:
14+
Enabled: false
15+
AcrossEmptyLines: false
16+
AcrossComments: false
17+
AlignCompound: false
18+
PadOperators: true
19+
AlignConsecutiveBitFields:
20+
Enabled: false
21+
AcrossEmptyLines: false
22+
AcrossComments: false
23+
AlignCompound: false
24+
PadOperators: false
25+
AlignConsecutiveDeclarations:
26+
Enabled: false
27+
AcrossEmptyLines: false
28+
AcrossComments: false
29+
AlignCompound: false
30+
PadOperators: false
31+
AlignConsecutiveMacros:
32+
Enabled: false
33+
AcrossEmptyLines: false
34+
AcrossComments: false
35+
AlignCompound: false
36+
PadOperators: false
37+
AlignEscapedNewlines: Left
38+
AlignOperands: Align
39+
AlignTrailingComments: true
40+
AllowAllArgumentsOnNextLine: true
41+
AllowAllParametersOfDeclarationOnNextLine: true
42+
AllowShortEnumsOnASingleLine: true
43+
AllowShortBlocksOnASingleLine: Never
44+
AllowShortCaseLabelsOnASingleLine: false
45+
AllowShortFunctionsOnASingleLine: All
46+
AllowShortLambdasOnASingleLine: All
47+
AllowShortIfStatementsOnASingleLine: WithoutElse
48+
AllowShortLoopsOnASingleLine: true
49+
AlwaysBreakAfterDefinitionReturnType: None
50+
AlwaysBreakAfterReturnType: None
51+
AlwaysBreakBeforeMultilineStrings: true
52+
AlwaysBreakTemplateDeclarations: Yes
53+
AttributeMacros:
54+
- __capability
55+
BinPackArguments: true
56+
BinPackParameters: true
57+
BraceWrapping:
58+
AfterCaseLabel: false
59+
AfterClass: false
60+
AfterControlStatement: Never
61+
AfterEnum: false
62+
AfterFunction: false
63+
AfterNamespace: false
64+
AfterObjCDeclaration: false
65+
AfterStruct: false
66+
AfterUnion: false
67+
AfterExternBlock: false
68+
BeforeCatch: false
69+
BeforeElse: false
70+
BeforeLambdaBody: false
71+
BeforeWhile: false
72+
IndentBraces: false
73+
SplitEmptyFunction: true
74+
SplitEmptyRecord: true
75+
SplitEmptyNamespace: true
76+
BreakBeforeBinaryOperators: None
77+
BreakBeforeConceptDeclarations: Always
78+
BreakBeforeBraces: Attach
79+
BreakBeforeInheritanceComma: false
80+
BreakInheritanceList: BeforeColon
81+
BreakBeforeTernaryOperators: true
82+
BreakConstructorInitializersBeforeComma: false
83+
BreakConstructorInitializers: BeforeColon
84+
BreakAfterJavaFieldAnnotations: false
85+
BreakStringLiterals: true
86+
ColumnLimit: 80
87+
CommentPragmas: '^ IWYU pragma:'
88+
QualifierAlignment: Leave
89+
CompactNamespaces: false
90+
ConstructorInitializerIndentWidth: 4
91+
ContinuationIndentWidth: 4
92+
Cpp11BracedListStyle: true
93+
DeriveLineEnding: true
94+
DerivePointerAlignment: true
95+
DisableFormat: false
96+
EmptyLineAfterAccessModifier: Never
97+
EmptyLineBeforeAccessModifier: LogicalBlock
98+
ExperimentalAutoDetectBinPacking: false
99+
PackConstructorInitializers: NextLine
100+
BasedOnStyle: ''
101+
ConstructorInitializerAllOnOneLineOrOnePerLine: false
102+
AllowAllConstructorInitializersOnNextLine: true
103+
FixNamespaceComments: true
104+
ForEachMacros:
105+
- foreach
106+
- Q_FOREACH
107+
- BOOST_FOREACH
108+
IfMacros:
109+
- KJ_IF_MAYBE
110+
IncludeBlocks: Regroup
111+
IncludeCategories:
112+
- Regex: '^<ext/.*\.h>'
113+
Priority: 2
114+
SortPriority: 0
115+
CaseSensitive: false
116+
- Regex: '^<.*\.h>'
117+
Priority: 1
118+
SortPriority: 0
119+
CaseSensitive: false
120+
- Regex: '^<.*'
121+
Priority: 2
122+
SortPriority: 0
123+
CaseSensitive: false
124+
- Regex: '.*'
125+
Priority: 3
126+
SortPriority: 0
127+
CaseSensitive: false
128+
IncludeIsMainRegex: '([-_](test|unittest))?$'
129+
IncludeIsMainSourceRegex: ''
130+
IndentAccessModifiers: false
131+
IndentCaseLabels: true
132+
IndentCaseBlocks: false
133+
IndentGotoLabels: true
134+
IndentPPDirectives: None
135+
IndentExternBlock: AfterExternBlock
136+
IndentRequiresClause: true
137+
IndentWidth: 2
138+
IndentWrappedFunctionNames: false
139+
InsertBraces: false
140+
InsertTrailingCommas: None
141+
JavaScriptQuotes: Leave
142+
JavaScriptWrapImports: true
143+
KeepEmptyLinesAtTheStartOfBlocks: false
144+
LambdaBodyIndentation: Signature
145+
MacroBlockBegin: ''
146+
MacroBlockEnd: ''
147+
MaxEmptyLinesToKeep: 1
148+
NamespaceIndentation: None
149+
ObjCBinPackProtocolList: Never
150+
ObjCBlockIndentWidth: 2
151+
ObjCBreakBeforeNestedBlockParam: true
152+
ObjCSpaceAfterProperty: false
153+
ObjCSpaceBeforeProtocolList: true
154+
PenaltyBreakAssignment: 2
155+
PenaltyBreakBeforeFirstCallParameter: 1
156+
PenaltyBreakComment: 300
157+
PenaltyBreakFirstLessLess: 120
158+
PenaltyBreakOpenParenthesis: 0
159+
PenaltyBreakString: 1000
160+
PenaltyBreakTemplateDeclaration: 10
161+
PenaltyExcessCharacter: 1000000
162+
PenaltyReturnTypeOnItsOwnLine: 200
163+
PenaltyIndentedWhitespace: 0
164+
PointerAlignment: Left
165+
PPIndentWidth: -1
166+
RawStringFormats:
167+
- Language: Cpp
168+
Delimiters:
169+
- cc
170+
- CC
171+
- cpp
172+
- Cpp
173+
- CPP
174+
- 'c++'
175+
- 'C++'
176+
CanonicalDelimiter: ''
177+
BasedOnStyle: google
178+
- Language: TextProto
179+
Delimiters:
180+
- pb
181+
- PB
182+
- proto
183+
- PROTO
184+
EnclosingFunctions:
185+
- EqualsProto
186+
- EquivToProto
187+
- PARSE_PARTIAL_TEXT_PROTO
188+
- PARSE_TEST_PROTO
189+
- PARSE_TEXT_PROTO
190+
- ParseTextOrDie
191+
- ParseTextProtoOrDie
192+
- ParseTestProto
193+
- ParsePartialTestProto
194+
CanonicalDelimiter: pb
195+
BasedOnStyle: google
196+
ReferenceAlignment: Pointer
197+
ReflowComments: true
198+
RemoveBracesLLVM: false
199+
RequiresClausePosition: OwnLine
200+
SeparateDefinitionBlocks: Leave
201+
ShortNamespaceLines: 1
202+
SortIncludes: CaseSensitive
203+
SortJavaStaticImport: Before
204+
SortUsingDeclarations: true
205+
SpaceAfterCStyleCast: false
206+
SpaceAfterLogicalNot: false
207+
SpaceAfterTemplateKeyword: true
208+
SpaceBeforeAssignmentOperators: true
209+
SpaceBeforeCaseColon: false
210+
SpaceBeforeCpp11BracedList: false
211+
SpaceBeforeCtorInitializerColon: true
212+
SpaceBeforeInheritanceColon: true
213+
SpaceBeforeParens: Never
214+
SpaceAroundPointerQualifiers: Default
215+
SpaceBeforeRangeBasedForLoopColon: true
216+
SpaceInEmptyBlock: false
217+
SpaceInEmptyParentheses: false
218+
SpacesBeforeTrailingComments: 2
219+
SpacesInAngles: Never
220+
SpacesInConditionalStatement: false
221+
SpacesInContainerLiterals: true
222+
SpacesInCStyleCastParentheses: false
223+
SpacesInLineCommentPrefix:
224+
Minimum: 1
225+
Maximum: -1
226+
SpacesInParentheses: false
227+
SpacesInSquareBrackets: false
228+
SpaceBeforeSquareBrackets: false
229+
BitFieldColonSpacing: Both
230+
Standard: Auto
231+
StatementAttributeLikeMacros:
232+
- Q_EMIT
233+
StatementMacros:
234+
- Q_UNUSED
235+
- QT_REQUIRE_VERSION
236+
TabWidth: 8
237+
UseCRLF: false
238+
UseTab: Never
239+
WhitespaceSensitiveMacros:
240+
- STRINGIZE
241+
- PP_STRINGIZE
242+
- BOOST_PP_STRINGIZE
243+
- NS_SWIFT_NAME
244+
- CF_SWIFT_NAME
245+
...
246+
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Run clang-format
2+
3+
on: [push]
4+
5+
jobs:
6+
linter:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: List Contents
11+
shell: bash
12+
run: ls -lhta ${{ github.workspace }} && git -C ${{ github.workspace }} rev-parse HEAD
13+
- uses: DoozyX/[email protected]
14+
with:
15+
source: 'include src tests'
16+
extensions: 'hpp,cxx,hpp.in,h,c'
17+
clangFormatVersion: 15
18+
inplace: True
19+
- uses: EndBug/add-and-commit@v4
20+
with:
21+
author_name: Clang Robot
22+
author_email: [email protected]
23+
message: 'Committing clang-format changes'
24+
env:
25+
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)