Skip to content

Commit 1ca70bb

Browse files
authoredSep 19, 2024··
Merge pull request #472 from aol-nnov/define-codestyle
Define codestyle
2 parents 472781c + 0fca716 commit 1ca70bb

File tree

285 files changed

+19083
-17838
lines changed

Some content is hidden

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

285 files changed

+19083
-17838
lines changed
 

‎.clang-format

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
BasedOnStyle: WebKit
3+
Language: Cpp
4+
AlignAfterOpenBracket: Align
5+
AllowShortEnumsOnASingleLine: false
6+
BreakInheritanceList: AfterColon
7+
BreakConstructorInitializers: AfterColon
8+
SpaceBeforeCtorInitializerColon: false
9+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
10+
AllowAllConstructorInitializersOnNextLine: false
11+
SpaceBeforeInheritanceColon: false
12+
PointerAlignment: Left
13+
ReflowComments: true
14+
FixNamespaceComments: true
15+
SortIncludes: true
16+
SortUsingDeclarations: true
17+
IncludeBlocks: Regroup
18+
# regular expressions are matched against the filename of an include (including the <> or “”) in order:
19+
# topmost: main header file (the one that has the same name as .cpp-file) and ui_XXX.h, if exists
20+
# second group: local header files (i.e. "something.h")
21+
# third group: external header files (i.e. <smth/other.h>)
22+
# fourth group: Qt toolkit headers (actually, anything that starts with a 'Q')
23+
# last group: all other external header files
24+
# headers in all groups are sorted by name
25+
IncludeCategories:
26+
- Regex: '"ui_.*'
27+
Priority: 0
28+
- Regex: '^".*'
29+
Priority: 1
30+
- Regex: '^<Qt.*'
31+
Priority: 3
32+
- Regex: '^<.*/.*\.h>'
33+
Priority: 2
34+
- Regex: '^<Q.*'
35+
Priority: 3
36+
- Regex: '^<.*'
37+
Priority: 4
38+
ColumnLimit: 100
39+
TabWidth: 4
40+
UseTab: Never
41+
MaxEmptyLinesToKeep: 1

‎.github/workflows/cmake.yml

+13
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ env:
1111
BUILD_TYPE: Release
1212

1313
jobs:
14+
check-code-style:
15+
runs-on: ubuntu-22.04
16+
name: "Check code style"
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
- name: Perform check
21+
run: ./tools/check_code_style.sh
22+
1423
build:
1524
runs-on: ubuntu-${{ matrix.ubuntu_version }}
1625
name: Ubuntu-${{ matrix.ubuntu_version }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }}
26+
needs: check-code-style
1727
strategy:
1828
fail-fast: false
1929
matrix:
@@ -55,6 +65,7 @@ jobs:
5565
MSVC:
5666
name: windows-${{ matrix.win_version }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }}
5767
runs-on: windows-${{ matrix.win_version }}
68+
needs: check-code-style
5869
strategy:
5970
fail-fast: false
6071
matrix:
@@ -96,6 +107,7 @@ jobs:
96107
MinGW-w64:
97108
runs-on: windows-2022
98109
name: msys2-${{ matrix.msystem }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }}
110+
needs: check-code-style
99111
strategy:
100112
fail-fast: false
101113
matrix:
@@ -165,6 +177,7 @@ jobs:
165177
macos:
166178
runs-on: macos-${{ matrix.macos_version }}
167179
name: macos-${{ matrix.macos_version }}-Qt-${{ matrix.qt_version }}-static-${{ matrix.static }}
180+
needs: check-code-style
168181
strategy:
169182
fail-fast: false
170183
matrix:

0 commit comments

Comments
 (0)
Please sign in to comment.