Skip to content

Commit f0e5ecd

Browse files
committed
CI: Add new workflow to check clang-format
1 parent b2b6d83 commit f0e5ecd

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed
Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
---
2-
BasedOnStyle: Google
3-
Language: Cpp
4-
Standard: Cpp03
2+
# Indentation for all files
3+
ColumnLimit: 120
4+
IndentWidth: 4
55
TabWidth: 4
66
UseTab: Never
7-
ColumnLimit: 120
8-
NamespaceIndentation: All
7+
8+
# C++ Options
9+
Language: Cpp
10+
Standard: c++17
11+
12+
BasedOnStyle: Google
13+
14+
IncludeBlocks: Preserve
915

1016
AccessModifierOffset: -4
1117
ContinuationIndentWidth: 4
12-
IndentWidth: 4
1318

19+
# Constructor initializers better formatted in presence of preprocessor conditions (see image.cpp)
20+
BreakConstructorInitializers: AfterColon
21+
AllowAllConstructorInitializersOnNextLine: true
22+
23+
# break braces for most of the cases (except conditionals and loops)
1424
BreakBeforeBraces: Custom
1525
BraceWrapping:
1626
AfterStruct: true
@@ -20,11 +30,12 @@ BraceWrapping:
2030
AfterEnum: true
2131
AfterNamespace: true
2232

33+
# Do not allow SingleLine statements (to improve coverage statistics)
2334
AllowShortFunctionsOnASingleLine: None
2435
AllowShortBlocksOnASingleLine: false
2536
AllowShortIfStatementsOnASingleLine: false
2637
AllowShortLoopsOnASingleLine: false
2738

28-
IncludeBlocks: Preserve
39+
Cpp11BracedListStyle: true
2940

3041
...
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Clang Format Checker
2+
on: [push]
3+
jobs:
4+
clang-format-checking:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: DoozyX/[email protected]
9+
with:
10+
source: '.'
11+
exclude: './xmpsdk ./contrib'
12+
extensions: 'c,h,cpp,hpp'
13+
clangFormatVersion: 12
14+
style: file

0 commit comments

Comments
 (0)