diff --git a/plugins/repos-validate/README.md b/plugins/repos-validate/README.md index 35d2781..b9d87e0 100644 --- a/plugins/repos-validate/README.md +++ b/plugins/repos-validate/README.md @@ -82,6 +82,10 @@ Example output: ```console ✅ config.yaml syntax is valid. + 42 repositories in config + 15 unique tags: api, backend, cli, deprecated, frontend, gh:automation, gh:cli, gh:rust, java, javascript, microservice, python, rust, typescript, web + +Validation finished successfully. ``` ### Validate syntax and check repository connectivity @@ -97,6 +101,8 @@ Example output: ```console ✅ config.yaml syntax is valid. + 42 repositories in config + 15 unique tags: api, backend, cli, deprecated, frontend, gh:automation, gh:cli, gh:rust, java, javascript, microservice, python, rust, typescript, web Validating repository connectivity... ✅ codcod/repos: Accessible. @@ -118,6 +124,8 @@ Example output: ```console ✅ config.yaml syntax is valid. + 42 repositories in config + 15 unique tags: api, backend, cli, deprecated, frontend, gh:automation, gh:cli, gh:rust, java, javascript, microservice, python, rust, typescript, web Validating repository connectivity... ✅ codcod/repos: Accessible. @@ -141,6 +149,8 @@ Example output: ```console ✅ config.yaml syntax is valid. + 42 repositories in config + 15 unique tags: api, backend, cli, deprecated, frontend, gh:automation, gh:cli, gh:rust, java, javascript, microservice, python, rust, typescript, web Validating repository connectivity... ✅ codcod/repos: Accessible. diff --git a/plugins/repos-validate/src/main.rs b/plugins/repos-validate/src/main.rs index 680e3fa..3aeea03 100644 --- a/plugins/repos-validate/src/main.rs +++ b/plugins/repos-validate/src/main.rs @@ -38,6 +38,21 @@ async fn main() -> Result<()> { } println!("{}", "✅ config.yaml syntax is valid.".green()); + + // Display summary information + println!(" {} repositories in config", repos.len()); + + // Collect and display unique tags + let unique_tags = get_unique_tags(&repos); + if !unique_tags.is_empty() { + println!( + " {} unique tags: {}", + unique_tags.len(), + unique_tags.join(", ") + ); + } else { + println!(" No tags defined"); + } println!(); if !args.connect { @@ -192,6 +207,20 @@ fn parse_github_url(url: &str) -> Result<(String, String)> { anyhow::bail!("Unsupported repository URL format: {}", url) } +fn get_unique_tags(repos: &[Repository]) -> Vec { + let mut tags: HashSet = HashSet::new(); + + for repo in repos { + for tag in &repo.tags { + tags.insert(tag.clone()); + } + } + + let mut sorted_tags: Vec = tags.into_iter().collect(); + sorted_tags.sort(); + sorted_tags +} + fn get_config_path() -> Result { // Try to get config path from environment variable set by repos CLI if let Ok(config) = std::env::var("REPOS_CONFIG_FILE") {