Skip to content

Commit 0556778

Browse files
ZnPdCoactions-user
andauthored
feat(check_format.yml): update ci, use pachadotdev/clang-format with clang-format v21 (#305)
* update clang-format * update clang-format * style: format codes --------- Co-authored-by: GitHub Action (clang-format) <action@github.com>
1 parent 563b2c6 commit 0556778

5 files changed

Lines changed: 13 additions & 26 deletions

File tree

.github/workflows/check_format.yml

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,8 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v6
11-
- name: "Install clang-format"
12-
run: |
13-
sudo apt-get update
14-
sudo apt-get install clang-format
15-
- name: "Format Codes"
16-
run: clang-format -i src/*.cpp src/*.h src/**/*.cpp src/**/*.h src/**/**/*.cpp src/**/**/*.h src/**/*.hpp
17-
- name: Check diff
18-
run: git diff --exit-code HEAD
19-
- name: Create Pull Request
20-
if: failure()
21-
uses: peter-evans/create-pull-request@v8
11+
- uses: pachadotdev/clang-format@v1.1
2212
with:
13+
version: "21"
14+
auto-commit: true
2315
commit-message: "style: format codes"
24-
title: "Format codes for ${{ github.ref }}"
25-
labels: "style"
26-
assignees: "${{ github.actor }}"
27-
reviewers: "${{ github.actor }}"
28-
branch: "auto-pr/clang-format/${{ github.ref }}"

src/base/LemonBaseApplication.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace Lemon {
1818
public:
1919
LemonBaseApplication(int &argc, char *argv[])
2020
: SingleApplication(argc, argv, true, User | ExcludeAppPath | ExcludeAppVersion),
21-
LemonApplicationInterface(){};
22-
virtual ~LemonBaseApplication(){};
21+
LemonApplicationInterface() {};
22+
virtual ~LemonBaseApplication() {};
2323

2424
virtual bool Initialize() final;
2525

src/core/processrunner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
ProcessRunner::ProcessRunner(ProcessRunnerConfig cfg, const std::atomic<bool> &stop)
1717
: config(std::move(cfg)), stopFlag(stop) {}
1818

19-
auto ProcessRunner::create(ProcessRunnerConfig config,
20-
const std::atomic<bool> &stopFlag) -> std::unique_ptr<ProcessRunner> {
19+
auto ProcessRunner::create(ProcessRunnerConfig config, const std::atomic<bool> &stopFlag)
20+
-> std::unique_ptr<ProcessRunner> {
2121
#ifdef Q_OS_WIN32
2222
return std::make_unique<WinProcessRunner>(std::move(config), stopFlag);
2323
#else

src/lemon.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,8 @@ void LemonLime::addTaskWithScoreScale(const QString &title,
879879
}
880880
}
881881

882-
auto LemonLime::compareFileName(const std::pair<QString, QString> &a,
883-
const std::pair<QString, QString> &b) -> bool {
882+
auto LemonLime::compareFileName(const std::pair<QString, QString> &a, const std::pair<QString, QString> &b)
883+
-> bool {
884884
return (a.first.length() < b.first.length()) ||
885885
(a.first.length() == b.first.length() && QString::localeAwareCompare(a.first, b.first) < 0);
886886
}

src/statisticsbrowser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ StatisticsBrowser::~StatisticsBrowser() { delete ui; }
3333

3434
void StatisticsBrowser::setContest(Contest *contest) { curContest = contest; }
3535

36-
auto StatisticsBrowser::getScoreNormalChart(const QMap<int, int> &scoreCount, int listSize,
37-
int totalScore) -> QString {
36+
auto StatisticsBrowser::getScoreNormalChart(const QMap<int, int> &scoreCount, int listSize, int totalScore)
37+
-> QString {
3838
QString buffer = "";
3939
long long overallScoreSum = 0;
4040
double scoreDiscrim = 0;
@@ -230,8 +230,8 @@ auto StatisticsBrowser::getTestcaseScoreChart(QList<TestCase *> testCaseList,
230230
return buffer;
231231
}
232232

233-
auto StatisticsBrowser::checkValid(QList<Task *> taskList,
234-
const QList<Contestant *> &contestantList) -> bool {
233+
auto StatisticsBrowser::checkValid(QList<Task *> taskList, const QList<Contestant *> &contestantList)
234+
-> bool {
235235
for (auto *i : taskList) {
236236
for (auto *j : i->getTestCaseList()) {
237237
if (j->getInputFiles().length() != j->getOutputFiles().length())

0 commit comments

Comments
 (0)