From 430ca28f27713779c581519f7667e6b536a110df Mon Sep 17 00:00:00 2001 From: Isaac Cheng <47993930+IsaacCheng9@users.noreply.github.com> Date: Mon, 11 May 2026 01:01:13 +0100 Subject: [PATCH 1/3] fix: Add `.clang-format` with LLVM style, fix flagged line --- .clang-format | 3 +++ tests/wal_test.cpp | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .clang-format diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..941486e --- /dev/null +++ b/.clang-format @@ -0,0 +1,3 @@ +--- +BasedOnStyle: LLVM +--- diff --git a/tests/wal_test.cpp b/tests/wal_test.cpp index 2a5a82a..17c725d 100644 --- a/tests/wal_test.cpp +++ b/tests/wal_test.cpp @@ -81,7 +81,9 @@ TEST(WALTest, ReplayGeneratesCorrectMemtable) { TEST(WALTest, ReplayOnEmptyFile) { const std::string path = "/tmp/kv_wal_empty_replay"; std::remove(path.c_str()); - { WAL wal(path); } + { + WAL wal(path); + } Memtable memtable; { From d6176923ed0f4b124030907722e68545706eb6e9 Mon Sep 17 00:00:00 2001 From: IsaacCheng9 <47993930+IsaacCheng9@users.noreply.github.com> Date: Mon, 11 May 2026 00:01:29 +0000 Subject: [PATCH 2/3] style: Format C++ code with clang-format --- tests/wal_test.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/wal_test.cpp b/tests/wal_test.cpp index 17c725d..2a5a82a 100644 --- a/tests/wal_test.cpp +++ b/tests/wal_test.cpp @@ -81,9 +81,7 @@ TEST(WALTest, ReplayGeneratesCorrectMemtable) { TEST(WALTest, ReplayOnEmptyFile) { const std::string path = "/tmp/kv_wal_empty_replay"; std::remove(path.c_str()); - { - WAL wal(path); - } + { WAL wal(path); } Memtable memtable; { From 8f88f8229afdd384471b2f613719f697528c71be Mon Sep 17 00:00:00 2001 From: Isaac Cheng <47993930+IsaacCheng9@users.noreply.github.com> Date: Mon, 11 May 2026 01:03:25 +0100 Subject: [PATCH 3/3] fix: Pin `AllowShortBlocksOnASingleLine` in `.clang-format` --- .clang-format | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.clang-format b/.clang-format index 941486e..eee240e 100644 --- a/.clang-format +++ b/.clang-format @@ -1,3 +1,10 @@ --- BasedOnStyle: LLVM +# Pin AllowShortBlocksOnASingleLine to Always - the LLVM default flipped +# from Always to Never between clang-format versions, so without the +# explicit setting CI (older Ubuntu clang-format) and modern local +# installs would oscillate between collapsing and expanding short braced +# blocks like `{ WAL wal(path); }` in tests/wal_test.cpp. Pinning to +# Always matches CI's behaviour and keeps the existing concise style. +AllowShortBlocksOnASingleLine: Always ---