From d70b24b6663e810ded33621c50e5ba72bd7df1cc Mon Sep 17 00:00:00 2001 From: chengpeiquan Date: Mon, 28 Apr 2025 23:16:21 +0800 Subject: [PATCH 1/3] chore: cleanup legacy files --- .husky/commit-msg | 1 - .husky/pre-commit | 1 - .npmrc | 2 -- .prettierignore | 2 -- .prettierrc | 4 ---- 5 files changed, 10 deletions(-) delete mode 100644 .husky/commit-msg delete mode 100644 .husky/pre-commit delete mode 100644 .npmrc delete mode 100644 .prettierignore delete mode 100644 .prettierrc diff --git a/.husky/commit-msg b/.husky/commit-msg deleted file mode 100644 index bdfc2a0..0000000 --- a/.husky/commit-msg +++ /dev/null @@ -1 +0,0 @@ -pnpm exec commit $1 diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index 8ba25f3..0000000 --- a/.husky/pre-commit +++ /dev/null @@ -1 +0,0 @@ -pnpm exec lint-staged --concurrent false diff --git a/.npmrc b/.npmrc deleted file mode 100644 index 009aa06..0000000 --- a/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -shamefully-hoist=true -auto-install-peers=true diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 8372aa1..0000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -CHANGELOG.md -config.json diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index b2095be..0000000 --- a/.prettierrc +++ /dev/null @@ -1,4 +0,0 @@ -{ - "semi": false, - "singleQuote": true -} From f02a1c55a96c933ebfffcf41cd04f2319ac6f132 Mon Sep 17 00:00:00 2001 From: chengpeiquan Date: Mon, 28 Apr 2025 23:19:44 +0800 Subject: [PATCH 2/3] fix(windows): statically link MSVC CRT to fix missing vcruntime140.dll issue --- .cargo/config.toml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..e9967dc --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,8 @@ +# On Windows MSVC, statically link the C runtime so that the resulting EXE does +# not depend on the vcruntime DLL. +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] +[target.i686-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] +[target.aarch64-pc-windows-msvc] +rustflags = ["-C", "target-feature=+crt-static"] From b1b8f52c93ef17c4ad14dfe49ef4c5af75749f73 Mon Sep 17 00:00:00 2001 From: chengpeiquan Date: Mon, 28 Apr 2025 23:55:55 +0800 Subject: [PATCH 3/3] fix(report): deduplicate commit messages within each group in the report --- src/main.rs | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index eeac073..a282b8d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,10 @@ mod config; mod i18n; mod utils; -use std::{collections::HashMap, path::PathBuf}; +use std::{ + collections::{HashMap, HashSet}, + path::PathBuf, +}; use config::{init_config, print_config}; use i18n::t; @@ -26,6 +29,9 @@ fn run(root_path: PathBuf) -> Result<(), Box> { let mut result: HashMap>> = HashMap::new(); + // Deduplicate logs by repoName and typeName + let mut dedup_map: HashMap>> = HashMap::new(); + for repo_dir in &config.repos { // Get repo name let repo_name = @@ -60,12 +66,23 @@ fn run(root_path: PathBuf) -> Result<(), Box> { for log in filtered_logs { let log_info = format_log(&log); let type_name = log_info.type_name.clone(); - result + + // get HashSet of type_name in repo_name, if not exist, create a new one + let type_set = dedup_map .entry(repo_name.clone()) .or_default() - .entry(type_name) - .or_default() - .push(log_info); + .entry(type_name.clone()) + .or_default(); + + // if message not in type_set, push to result + if type_set.insert(log_info.message.clone()) { + result + .entry(repo_name.clone()) + .or_default() + .entry(type_name) + .or_default() + .push(log_info); + } } save_report_markdown(&result, &root_path)?;