Skip to content

Commit f12ce37

Browse files
Zijian ZhangKawaiiNahida
Zijian Zhang
authored andcommitted
ci: check code style with clang-format
1 parent 302350e commit f12ce37

File tree

8 files changed

+19
-16
lines changed

8 files changed

+19
-16
lines changed

.github/workflows/build_docs.yml

+6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
on:
22
push:
3+
paths:
4+
- .github/workflows/build_docs.yml
5+
- docs/**
6+
- src/**/*.h
7+
- Doxyfile
8+
- DoxygenLayout.xml
39
workflow_dispatch:
410

511
jobs:

.github/workflows/build_levilamina.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,13 @@ jobs:
155155
build/windows/x64/debug/LeviLamina.pdb
156156
157157
check-style:
158-
runs-on: ubuntu-latest
158+
runs-on: windows-latest
159159
steps:
160160
- uses: actions/checkout@v4
161161

162-
- uses: actions/setup-node@v3
163-
with:
164-
node-version: 18
165-
166162
- run: |
167-
npm install clang-format@1.8.0
163+
choco install llvm -y --version=17.0.6
168164
169165
- run: |
170-
npx clang-format --dry-run --Werror $(find src/ -type f -name '*.cpp' -o -name '*.h')
166+
Get-ChildItem src/ -Filter *.cpp -Recurse | ForEach-Object { clang-format -i -Werror $_.FullName }
167+
Get-ChildItem src/ -Filter *.h -Recurse | ForEach-Object { clang-format -i -Werror $_.FullName }

src/ll/api/memory/PatchHelper.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ namespace ll::utils {
5151

5252
template <size_t len>
5353
struct PatchHelper {
54-
uchar data[len];
54+
uchar data[len];
5555
using ref_t = uchar (&)[len];
56-
constexpr bool operator==(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) == 0; }
57-
constexpr bool operator!=(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) != 0; }
58-
constexpr bool operator==(PatchHelper const& ref) const noexcept {
56+
constexpr bool operator==(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) == 0; }
57+
constexpr bool operator!=(ref_t ref) const noexcept { return memcmp(data, ref, sizeof data) != 0; }
58+
constexpr bool operator==(PatchHelper const& ref) const noexcept {
5959
return memcmp(data, ref.data, sizeof data) == 0;
6060
}
6161
constexpr bool operator!=(PatchHelper const& ref) const noexcept {

src/mc/common/wrapper/optional_ref.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class optional_ref {
104104
return std::invoke(*mPtr, static_cast<Types&&>(args)...);
105105
}
106106
template <class Arg>
107-
[[nodiscard]] constexpr decltype(auto) operator[](Arg && index) const {
107+
[[nodiscard]] constexpr decltype(auto) operator[](Arg&& index) const {
108108
return get()[std::forward<Arg>(index)];
109109
}
110110
[[nodiscard]] constexpr decltype(auto) end() { return get().end(); }

src/mc/deps/core/common/bedrock/MemoryPage.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class MemoryPage {
3535
// symbol: ?_allocate@MemoryPage@JSONObject@Bedrock@@AEAAPEAXP8123@EAA_K_K0@ZP8123@EAAPEAX00@Z00@Z
3636
MCAPI void* _allocate(
3737
uint64 (Bedrock::JSONObject::MemoryPage::*)(uint64, uint64),
38-
void* (Bedrock::JSONObject::MemoryPage::*)(uint64, uint64),
38+
void* (Bedrock::JSONObject::MemoryPage::*)(uint64, uint64),
3939
uint64,
4040
uint64
4141
);

src/mc/deps/core/utility/Util.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ MCAPI std::vector<std::string> splitLines(
226226
std::vector<std::string> const& delims,
227227
bool includeDelimCharsInResult,
228228
bool includeEmptyLines,
229-
std::istream& (*fnGetline)(std::istream&, std::string&)
229+
std::istream& (*fnGetline)(std::istream&, std::string&)
230230
);
231231

232232
// symbol:

src/mc/deps/raknet/RakPeer.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ class RakPeer : public RakPeerInterface {
427427

428428
// symbol: ?SetUserUpdateThread@RakPeer@RakNet@@UEAAXP6AXPEAVRakPeerInterface@2@PEAX@Z1@Z
429429
MCVAPI void SetUserUpdateThread(
430-
void (*_userUpdateThreadPtr)(class RakNet::RakPeerInterface*, void*),
430+
void (*_userUpdateThreadPtr)(class RakNet::RakPeerInterface*, void*),
431431
void* _userUpdateThreadData
432432
);
433433

src/mc/world/actor/SynchedActorDataEntityWrapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class SynchedActorDataEntityWrapper {
99
public:
10-
int (**_vptr_SynchedActorDataEntityWrapper)(void);
10+
int (**_vptr_SynchedActorDataEntityWrapper)(void);
1111
gsl::not_null<class SynchedActorDataComponent*> mData;
1212

1313
template <typename T>

0 commit comments

Comments
 (0)