Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -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"]
1 change: 0 additions & 1 deletion .husky/commit-msg

This file was deleted.

1 change: 0 additions & 1 deletion .husky/pre-commit

This file was deleted.

2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

2 changes: 0 additions & 2 deletions .prettierignore

This file was deleted.

4 changes: 0 additions & 4 deletions .prettierrc

This file was deleted.

27 changes: 22 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,6 +29,9 @@ fn run(root_path: PathBuf) -> Result<(), Box<dyn std::error::Error>> {

let mut result: HashMap<String, HashMap<String, Vec<LogInfo>>> = HashMap::new();

// Deduplicate logs by repoName and typeName
let mut dedup_map: HashMap<String, HashMap<String, HashSet<String>>> = HashMap::new();

for repo_dir in &config.repos {
// Get repo name
let repo_name =
Expand Down Expand Up @@ -60,12 +66,23 @@ fn run(root_path: PathBuf) -> Result<(), Box<dyn std::error::Error>> {
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)?;
Expand Down
Loading