From 1ce9b0c930d12dedd4bdfe3a0f53fd11596de909 Mon Sep 17 00:00:00 2001 From: Bambooin Date: Thu, 7 Mar 2024 21:26:33 +0800 Subject: [PATCH 1/2] fix: format with clang-foramt 18.1 --- src/rime/algo/encoder.cc | 8 ++++---- src/rime/dict/dict_compiler.cc | 4 ++-- src/rime/dict/entry_collector.cc | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/rime/algo/encoder.cc b/src/rime/algo/encoder.cc index 64290424a..8e793c6aa 100644 --- a/src/rime/algo/encoder.cc +++ b/src/rime/algo/encoder.cc @@ -255,13 +255,13 @@ bool TableEncoder::DfsEncode(const string& phrase, } string encoded; if (Encode(*code, &encoded)) { - DLOG(INFO) << "encode '" << phrase << "': " - << "[" << code->ToString() << "] -> [" << encoded << "]"; + DLOG(INFO) << "encode '" << phrase << "': " << "[" << code->ToString() + << "] -> [" << encoded << "]"; collector_->CreateEntry(phrase, encoded, value); return true; } else { - DLOG(WARNING) << "failed to encode '" << phrase << "': " - << "[" << code->ToString() << "]"; + DLOG(WARNING) << "failed to encode '" << phrase << "': " << "[" + << code->ToString() << "]"; return false; } } diff --git a/src/rime/dict/dict_compiler.cc b/src/rime/dict/dict_compiler.cc index 5996ee2cc..3d4ddaa23 100644 --- a/src/rime/dict/dict_compiler.cc +++ b/src/rime/dict/dict_compiler.cc @@ -123,8 +123,8 @@ bool DictCompiler::Compile(const path& schema_file) { } else { rebuild_prism = true; } - LOG(INFO) << dict_file << "[" << dict_files.size() << " file(s)]" - << " (" << dict_file_checksum << ")"; + LOG(INFO) << dict_file << "[" << dict_files.size() << " file(s)]" << " (" + << dict_file_checksum << ")"; LOG(INFO) << schema_file << " (" << schema_file_checksum << ")"; { the resolver( diff --git a/src/rime/dict/entry_collector.cc b/src/rime/dict/entry_collector.cc index e9fa7404a..2fa571d87 100644 --- a/src/rime/dict/entry_collector.cc +++ b/src/rime/dict/entry_collector.cc @@ -114,8 +114,8 @@ void EntryCollector::Collect(const path& dict_file) { encode_queue.push({word, weight_str}); } if (!stem_str.empty() && !code_str.empty()) { - DLOG(INFO) << "add stem '" << word << "': " - << "[" << code_str << "] = [" << stem_str << "]"; + DLOG(INFO) << "add stem '" << word << "': " << "[" << code_str << "] = [" + << stem_str << "]"; stems[word].insert(stem_str); } } From 56fe19424b91ee2ac2a65d669f98869443c72d17 Mon Sep 17 00:00:00 2001 From: Bambooin Date: Mon, 11 Mar 2024 21:03:37 +0800 Subject: [PATCH 2/2] ci: install latest clang-format --- .github/workflows/commit-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/commit-ci.yml b/.github/workflows/commit-ci.yml index cc16c3dff..56038e1fd 100644 --- a/.github/workflows/commit-ci.yml +++ b/.github/workflows/commit-ci.yml @@ -14,9 +14,9 @@ jobs: steps: - name: Checkout last commit uses: actions/checkout@v4 - - name: Install clang-format - run: brew install clang-format - - name: Lint + - name: Install latest lang-format + run: brew update && brew install clang-format + - name: Code style lint run: make clang-format-lint linux: