Skip to content

Commit 7034491

Browse files
committed
style: add clang format
1 parent db47b5c commit 7034491

File tree

149 files changed

+1588
-1616
lines changed

Some content is hidden

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

149 files changed

+1588
-1616
lines changed

.clang-format

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Generated from CLion C/C++ Code Style settings
2+
BasedOnStyle: LLVM
3+
AccessModifierOffset: -4
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveAssignments: Consecutive
6+
AlignConsecutiveDeclarations: Consecutive
7+
AlignConsecutiveMacros: Consecutive
8+
AlignOperands: Align
9+
AllowAllArgumentsOnNextLine: false
10+
AllowAllConstructorInitializersOnNextLine: false
11+
AllowAllParametersOfDeclarationOnNextLine: false
12+
AllowShortBlocksOnASingleLine: Always
13+
AllowShortCaseLabelsOnASingleLine: false
14+
AllowShortFunctionsOnASingleLine: All
15+
AllowShortIfStatementsOnASingleLine: Always
16+
AllowShortLambdasOnASingleLine: All
17+
AllowShortLoopsOnASingleLine: true
18+
AlwaysBreakAfterReturnType: None
19+
AlwaysBreakTemplateDeclarations: Yes
20+
BreakBeforeBraces: Custom
21+
BraceWrapping:
22+
AfterCaseLabel: false
23+
AfterClass: false
24+
AfterControlStatement: Never
25+
AfterEnum: false
26+
AfterFunction: false
27+
AfterNamespace: false
28+
AfterUnion: false
29+
BeforeCatch: false
30+
BeforeElse: false
31+
IndentBraces: false
32+
SplitEmptyFunction: false
33+
SplitEmptyRecord: true
34+
BreakBeforeBinaryOperators: None
35+
BreakBeforeTernaryOperators: true
36+
BreakConstructorInitializers: BeforeColon
37+
BreakInheritanceList: BeforeColon
38+
ColumnLimit: 0
39+
CompactNamespaces: false
40+
ContinuationIndentWidth: 8
41+
IndentCaseLabels: true
42+
IndentPPDirectives: BeforeHash
43+
IndentWidth: 4
44+
KeepEmptyLinesAtTheStartOfBlocks: true
45+
MaxEmptyLinesToKeep: 2
46+
NamespaceIndentation: All
47+
ObjCSpaceAfterProperty: false
48+
ObjCSpaceBeforeProtocolList: true
49+
PointerAlignment: Left
50+
ReflowComments: false
51+
SpaceAfterCStyleCast: true
52+
SpaceAfterLogicalNot: false
53+
SpaceAfterTemplateKeyword: false
54+
SpaceBeforeAssignmentOperators: true
55+
SpaceBeforeCpp11BracedList: false
56+
SpaceBeforeCtorInitializerColon: true
57+
SpaceBeforeInheritanceColon: true
58+
SpaceBeforeParens: ControlStatements
59+
SpaceBeforeRangeBasedForLoopColon: true
60+
SpaceInEmptyParentheses: false
61+
SpacesBeforeTrailingComments: 0
62+
SpacesInAngles: false
63+
SpacesInCStyleCastParentheses: false
64+
SpacesInContainerLiterals: false
65+
SpacesInParentheses: false
66+
SpacesInSquareBrackets: false
67+
TabWidth: 4
68+
UseTab: Never

.github/workflows/clang-format.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Clang Format
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- '.github/**'
8+
- 'cubool/**'
9+
- '.clang-format'
10+
pull_request:
11+
branches: [ main ]
12+
13+
jobs:
14+
formatting-check:
15+
name: Formatting Check
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
path:
21+
- 'cubool'
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Run clang-format style check
25+
uses: jidicula/clang-format-action@v4.15.0
26+
with:
27+
clang-format-version: '20'
28+
check-path: ${{ matrix.path }}

0 commit comments

Comments
 (0)