Skip to content

Commit 7355a5c

Browse files
committed
Add clang format to action
1 parent 0ffae71 commit 7355a5c

File tree

7 files changed

+35
-34
lines changed

7 files changed

+35
-34
lines changed

.github/workflows/check.yml

+19-19
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
name: CI
2-
32
on:
43
push:
54
branches:
65
- master
76
pull_request:
87
branches:
98
- master
10-
119
jobs:
10+
clang-format:
11+
name: Check clang-format
12+
runs-on: ubuntu-latest
13+
container: archlinux:latest
14+
steps:
15+
- name: Install dependencies
16+
run: |
17+
pacman -Syu --noconfirm git clang diffutils
18+
git config --global --add safe.directory $GITHUB_WORKSPACE
19+
- uses: actions/checkout@v4
20+
- uses: fcitx/github-actions@clang-format
1221
check:
1322
name: Build and test
23+
needs: clang-format
1424
runs-on: ubuntu-latest
1525
container: archlinux:latest
1626
strategy:
@@ -37,20 +47,15 @@ jobs:
3747
uses: actions/cache@v4
3848
with:
3949
path: 'fcitx5/**/*.tar.*'
40-
key: ${{ runner.os }}-${{ hashFiles('fcitx5/src/modules/spell/CMakeLists.txt') }}
50+
key: ${{ runner.os }}-${{ hashFiles('fcitx5/src/modules/spell/CMakeLists.txt')
51+
}}
4152
- name: Build and Install fcitx5
4253
uses: fcitx/github-actions@cmake
4354
with:
4455
path: fcitx5
4556
cmake-option: >-
46-
-DENABLE_KEYBOARD=Off
47-
-DENABLE_X11=Off
48-
-DENABLE_WAYLAND=Off
49-
-DENABLE_ENCHANT=Off
50-
-DENABLE_DBUS=Off
51-
-DENABLE_SERVER=Off
52-
-DENABLE_EMOJI=Off
53-
-DUSE_SYSTEMD=Off
57+
-DENABLE_KEYBOARD=Off -DENABLE_X11=Off -DENABLE_WAYLAND=Off -DENABLE_ENCHANT=Off
58+
-DENABLE_DBUS=Off -DENABLE_SERVER=Off -DENABLE_EMOJI=Off -DUSE_SYSTEMD=Off
5459
- uses: actions/checkout@v4
5560
with:
5661
repository: fcitx/fcitx5-qt
@@ -61,9 +66,7 @@ jobs:
6166
repository: fcitx/fcitx5-qt
6267
path: fcitx5-qt
6368
cmake-option: >-
64-
-DENABLE_QT4=Off
65-
-DENABLE_QT5=Off
66-
-DENABLE_QT6=On
69+
-DENABLE_QT4=Off -DENABLE_QT5=Off -DENABLE_QT6=On
6770
- uses: actions/checkout@v4
6871
with:
6972
repository: naokiri/cskk
@@ -78,9 +81,7 @@ jobs:
7881
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
7982
- name: Build and install cskk
8083
shell: bash
81-
run: |
82-
cd cskk
83-
cargo cinstall --release --prefix=/usr
84+
run: "cd cskk\ncargo cinstall --release --prefix=/usr \n"
8485
- uses: actions/checkout@v4
8586
with:
8687
path: fcitx5-cskk
@@ -94,8 +95,7 @@ jobs:
9495
with:
9596
path: fcitx5-cskk
9697
cmake-option: >-
97-
-DENABLE_QT=On
98-
-DUSE_QT6=On
98+
-DENABLE_QT=On -DUSE_QT6=On
9999
- name: Test
100100
run: |
101101
ctest --test-dir fcitx5-cskk/build

gui/adddictdialog.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* SPDX-FileCopyrightText: <text>2013~2022 CSSlayer <[email protected]>, Naoaki Iwakiri
3-
* <[email protected]></text>
2+
* SPDX-FileCopyrightText: <text>2013~2022 CSSlayer <[email protected]>, Naoaki
3+
* Iwakiri <[email protected]></text>
44
*
55
* SPDX-License-Identifier: GPL-3.0-or-later
66
*

gui/dictmodel.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* SPDX-FileCopyrightText: <text>2013~2022 CSSlayer <[email protected]>, Naoaki Iwakiri
3-
* <[email protected]></text>
2+
* SPDX-FileCopyrightText: <text>2013~2022 CSSlayer <[email protected]>, Naoaki
3+
* Iwakiri <[email protected]></text>
44
*
55
* SPDX-License-Identifier: GPL-3.0-or-later
66
*

gui/dictwidget.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
2-
* SPDX-FileCopyrightText: <text>2013~2022 CSSlayer <[email protected]>, Naoaki Iwakiri
3-
* <[email protected]></text>
2+
* SPDX-FileCopyrightText: <text>2013~2022 CSSlayer <[email protected]>, Naoaki
3+
* Iwakiri <[email protected]></text>
44
*
55
* SPDX-License-Identifier: GPL-3.0-or-later
66
*

gui/main.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
namespace fcitx {
1414

1515
class CskkConfigPlugin : public FcitxQtConfigUIPlugin {
16-
Q_OBJECT
16+
Q_OBJECT
1717
public:
18-
Q_PLUGIN_METADATA(IID FcitxQtConfigUIFactoryInterface_iid FILE
19-
"cskk-config.json")
20-
explicit CskkConfigPlugin(QObject *parent = 0);
21-
FcitxQtConfigUIWidget *create(const QString &key) override;
18+
Q_PLUGIN_METADATA(IID FcitxQtConfigUIFactoryInterface_iid FILE
19+
"cskk-config.json")
20+
explicit CskkConfigPlugin(QObject *parent = 0);
21+
FcitxQtConfigUIWidget *create(const QString &key) override;
2222
};
2323

2424
} // namespace fcitx

test/basic_test.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*
22
* Copyright (c) 2021 Naoaki Iwakiri
33
* This program is released under GNU General Public License version 3 or later
4-
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
4+
* You should have received a copy of the GNU General Public License along with
5+
* this program. If not, see <https://www.gnu.org/licenses/>.
56
*
67
* Creation Date: 2021-05-08
78
*

test/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/*
22
* Copyright (c) 2021 Naoaki Iwakiri
33
* This program is released under GNU General Public License version 3 or later
4-
* You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
4+
* You should have received a copy of the GNU General Public License along with
5+
* this program. If not, see <https://www.gnu.org/licenses/>.
56
*
67
* Creation Date: 2021-05-08
78
*
@@ -13,8 +14,7 @@
1314

1415
#include "gtest/gtest.h"
1516

16-
int main(int argc, char** argv) {
17+
int main(int argc, char **argv) {
1718
::testing::InitGoogleTest(&argc, argv);
1819
return RUN_ALL_TESTS();
1920
}
20-

0 commit comments

Comments
 (0)