Skip to content

Commit 8d56015

Browse files
authored
ci: Add style check to CI (#3)
* ci: add clang-format job and file * style: changes according to clang-format * fix: add correct trigger branches name
1 parent 077867a commit 8d56015

File tree

6 files changed

+426
-325
lines changed

6 files changed

+426
-325
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: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Clang Format
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths:
7+
- '.github/**'
8+
- 'src/**'
9+
- 'include/**'
10+
- 'tests/**'
11+
- '.clang-format'
12+
pull_request:
13+
branches: [ main ]
14+
15+
jobs:
16+
formatting-check:
17+
name: Formatting Check
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
path:
23+
- 'src'
24+
- 'include'
25+
- 'tests'
26+
steps:
27+
- uses: actions/checkout@v4
28+
29+
- name: Run clang-format style check
30+
uses: jidicula/[email protected]
31+
with:
32+
clang-format-version: '20'
33+
check-path: ${{ matrix.path }}

include/regular_path_query.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
#include <cubool/cubool.h>
44

55
cuBool_Matrix regular_path_query_with_transposed(
6-
// vector of sparse graph matrices for each label
7-
const std::vector<cuBool_Matrix> &graph, const std::vector<cuBool_Index> &source_vertices,
8-
// vector of sparse automaton matrices for each label
9-
const std::vector<cuBool_Matrix> &automaton, const std::vector<cuBool_Index> &start_states,
10-
// transposed matrices for graph and automaton
11-
const std::vector<cuBool_Matrix> &graph_transposed,
12-
const std::vector<cuBool_Matrix> &automaton_transposed,
6+
// vector of sparse graph matrices for each label
7+
const std::vector<cuBool_Matrix>& graph, const std::vector<cuBool_Index>& source_vertices,
8+
// vector of sparse automaton matrices for each label
9+
const std::vector<cuBool_Matrix>& automaton, const std::vector<cuBool_Index>& start_states,
10+
// transposed matrices for graph and automaton
11+
const std::vector<cuBool_Matrix>& graph_transposed,
12+
const std::vector<cuBool_Matrix>& automaton_transposed,
1313

14-
const std::vector<bool> &inversed_labels = {}, bool all_labels_are_inversed = false);
14+
const std::vector<bool>& inversed_labels = {}, bool all_labels_are_inversed = false);
1515

1616
cuBool_Matrix regular_path_query(
17-
// vector of sparse graph matrices for each label
18-
const std::vector<cuBool_Matrix> &graph, const std::vector<cuBool_Index> &source_vertices,
19-
// vector of sparse automaton matrices for each label
20-
const std::vector<cuBool_Matrix> &automaton, const std::vector<cuBool_Index> &start_states,
17+
// vector of sparse graph matrices for each label
18+
const std::vector<cuBool_Matrix>& graph, const std::vector<cuBool_Index>& source_vertices,
19+
// vector of sparse automaton matrices for each label
20+
const std::vector<cuBool_Matrix>& automaton, const std::vector<cuBool_Index>& start_states,
2121

22-
const std::vector<bool> &inversed_labels = {}, bool all_labels_are_inversed = false);
22+
const std::vector<bool>& inversed_labels = {}, bool all_labels_are_inversed = false);

0 commit comments

Comments
 (0)