Skip to content

Commit be9937a

Browse files
authored
Merge pull request #966 from arielswalker/fix-965-update-clang-format-match-internal
Fix #965, Update .clang-format to Match Internal File
2 parents 938ce08 + 9dc6c25 commit be9937a

2 files changed

Lines changed: 81 additions & 35 deletions

File tree

.clang-format

Lines changed: 79 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,85 @@
11
---
2-
Language: Cpp
3-
AccessModifierOffset: -4
2+
BasedOnStyle: Google
3+
AccessModifierOffset: '-4'
44
AlignAfterOpenBracket: Align
5-
AlignConsecutiveAssignments: true
6-
AlignConsecutiveDeclarations: true
7-
AlignConsecutiveMacros: true
5+
AlignArrayOfStructures: Left
6+
AlignConsecutiveAssignments:
7+
Enabled: true
8+
AcrossEmptyLines: false
9+
AcrossComments: true
10+
AlignCompound: true
11+
PadOperators: true
12+
AlignConsecutiveDeclarations:
13+
Enabled: true
14+
AcrossEmptyLines: false
15+
AcrossComments: true
16+
AlignCompound: true
17+
PadOperators: true
18+
AlignConsecutiveMacros:
19+
Enabled: true
20+
AcrossEmptyLines: false
21+
AcrossComments: true
22+
AlignCompound: true
23+
PadOperators: true
824
AlignEscapedNewlines: Left
9-
AlignOperands: true
25+
AlignConsecutiveBitFields: true
26+
AlignOperands: true
1027
AlignTrailingComments: true
11-
AllowAllParametersOfDeclarationOnNextLine: true
12-
AllowShortBlocksOnASingleLine: Empty
28+
AllowAllArgumentsOnNextLine: false
29+
AllowAllConstructorInitializersOnNextLine: false
30+
AllowAllParametersOfDeclarationOnNextLine: false
31+
AllowShortBlocksOnASingleLine: Never
1332
AllowShortCaseLabelsOnASingleLine: false
14-
AllowShortFunctionsOnASingleLine: Empty
33+
AllowShortFunctionsOnASingleLine: InlineOnly
1534
AllowShortIfStatementsOnASingleLine: false
1635
AllowShortLoopsOnASingleLine: false
1736
AlwaysBreakAfterReturnType: None
1837
AlwaysBreakBeforeMultilineStrings: false
19-
BinPackArguments: true
20-
BinPackParameters: true
21-
BreakBeforeBinaryOperators: None
38+
AlwaysBreakTemplateDeclarations: 'Yes'
39+
BinPackArguments: false
40+
BinPackParameters: false
41+
BraceWrapping:
42+
AfterCaseLabel: true
43+
AfterClass: true
44+
AfterControlStatement: Always
45+
AfterEnum: true
46+
AfterFunction: true
47+
AfterNamespace: false
48+
AfterObjCDeclaration: true
49+
AfterStruct: true
50+
AfterUnion: true
51+
AfterExternBlock: false
52+
BeforeCatch: true
53+
BeforeElse: true
54+
BeforeLambdaBody: false
55+
BeforeWhile: true
56+
IndentBraces: false
57+
SplitEmptyFunction: true
58+
SplitEmptyRecord: false
59+
SplitEmptyNamespace: false
60+
BreakBeforeBinaryOperators: NonAssignment
2261
BreakBeforeBraces: Allman
2362
BreakBeforeTernaryOperators: true
63+
BreakConstructorInitializers: AfterColon
64+
BreakInheritanceList: AfterColon
2465
BreakStringLiterals: true
25-
ColumnLimit: 120
26-
CommentPragmas: ''
27-
ContinuationIndentWidth: 4
28-
Cpp11BracedListStyle: true
66+
ColumnLimit: '120'
67+
CompactNamespaces: false
68+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
69+
ConstructorInitializerIndentWidth: '4'
70+
ContinuationIndentWidth: '4'
71+
Cpp11BracedListStyle: false
2972
DerivePointerAlignment: false
30-
DisableFormat: false
3173
ExperimentalAutoDetectBinPacking: false
32-
ForEachMacros: []
33-
IncludeBlocks: Preserve
34-
IncludeCategories: []
35-
IncludeIsMainRegex: '$'
74+
FixNamespaceComments: true
75+
IncludeBlocks: Preserve
3676
IndentCaseLabels: true
3777
IndentPPDirectives: None
38-
IndentWidth: 4
39-
KeepEmptyLinesAtTheStartOfBlocks: true
40-
MacroBlockBegin: ''
41-
MacroBlockEnd: ''
78+
IndentWidth: '4'
79+
KeepEmptyLinesAtTheStartOfBlocks: false
80+
Language: Cpp
4281
MaxEmptyLinesToKeep: 1
82+
NamespaceIndentation: None
4383
PenaltyBreakAssignment: 2
4484
PenaltyBreakBeforeFirstCallParameter: 19
4585
PenaltyBreakComment: 300
@@ -48,19 +88,24 @@ PenaltyBreakString: 1000
4888
PenaltyExcessCharacter: 1000000
4989
PenaltyReturnTypeOnItsOwnLine: 60
5090
PointerAlignment: Right
51-
ReflowComments: true
52-
SortIncludes: false
91+
ReflowComments: true
92+
SortIncludes: false
93+
SortUsingDeclarations: false
5394
SpaceAfterCStyleCast: false
95+
SpaceAfterTemplateKeyword: false
5496
SpaceBeforeAssignmentOperators: true
97+
SpaceBeforeCpp11BracedList: true
98+
SpaceBeforeCtorInitializerColon: true
99+
SpaceBeforeInheritanceColon: true
55100
SpaceBeforeParens: ControlStatements
101+
SpaceBeforeRangeBasedForLoopColon: false
56102
SpaceInEmptyParentheses: false
57-
SpaceBeforeCpp11BracedList: true
58-
SpacesBeforeTrailingComments: 1
103+
SpacesBeforeTrailingComments: '1'
104+
SpacesInAngles: false
59105
SpacesInCStyleCastParentheses: false
106+
SpacesInContainerLiterals: false
60107
SpacesInParentheses: false
61108
SpacesInSquareBrackets: false
62-
Standard: c++11
63-
TabWidth: 8
64-
UseTab: Never
65-
...
66-
109+
Standard: Cpp11
110+
TabWidth: '4'
111+
UseTab: Never

.github/workflows/format-check.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ jobs:
6767

6868
check-commit-message:
6969
name: Check Commit Message
70+
needs: check-for-duplicates
7071
# Only run for pull-requests.
7172
if: ${{ github.event_name == 'pull_request' && !startsWith(github.head_ref, 'ic-') }}
7273
runs-on: ubuntu-22.04
@@ -77,7 +78,7 @@ jobs:
7778
uses: gsactions/commit-message-checker@v2
7879
if: always()
7980
with:
80-
pattern: ^((Fix|HotFix|Part|Issue|Ticket)\s([a-zA-Z0-9_-]+/)?[a-zA-Z0-9_-]*\#[0-9]+[,:]\s.+|Merge\spull\srequest\s\#[0-9]+\s.+|IC:\s.+)
81+
pattern: '^((Fix|HotFix|Part|Issue|Ticket)\s(nasa/)?[a-zA-Z]*\#[0-9]+[,:]\s[a-zA-Z0-9]+|Merge\spull\srequest\s\#[0-9]+\s[a-zA-Z0-9]+|IC:\s[a-zA-Z0-9]+)'
8182
error: 'You need at least one "Fix|HotFix|Part|Issue|Ticket #<issue number><,|:> <short description>" line in the commit message.'
8283
excludeDescription: 'true'
8384
excludeTitle: 'true'

0 commit comments

Comments
 (0)