From b8a1a77abc1f7a7be92f2823edd334c4072ae2e9 Mon Sep 17 00:00:00 2001 From: platonicsocrates <47001602+platonicsocrates@users.noreply.github.com> Date: Sat, 25 Nov 2023 17:18:18 +0000 Subject: [PATCH] Revert "Add validation to ensure no empty ecos are added" This reverts commit 7fc98ca0febf4b2da7c8d4f4ebb5005b1939d89e. --- src/main.rs | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3f601a0869..b64ecd3c00 100644 --- a/src/main.rs +++ b/src/main.rs @@ -38,8 +38,6 @@ enum ValidationError { DuplicateRepoUrl(String), TitleError(String), - - EmptyEcosystem(String), } impl Display for ValidationError { @@ -54,9 +52,6 @@ impl Display for ValidationError { ValidationError::TitleError(file) => { write!(f, "Title with leading/trailing space found in file: {}. Please remove the space(s) from your title.", file) } - ValidationError::EmptyEcosystem(file) => { - write!(f, "Ecosystem in file {} has neither organizations nor sub-ecosystems. Please remove this. You can add it back later when/if you find its orgs / repos.", file) - } } } } @@ -134,14 +129,8 @@ fn validate_ecosystems(ecosystem_map: &EcosystemMap) -> Vec { for ecosystem in ecosystem_map.values() { let mut seen_repos = HashSet::new(); - let mut has_sub_ecosystems = false; - let mut has_orgs = false; - let mut has_repos = false; if let Some(ref sub_ecosystems) = ecosystem.sub_ecosystems { - if !sub_ecosystems.is_empty() { - has_sub_ecosystems = true; - } for sub in sub_ecosystems { if !ecosystem_map.contains_key(sub) { errors.push(ValidationError::MissingSubecosystem { @@ -152,16 +141,7 @@ fn validate_ecosystems(ecosystem_map: &EcosystemMap) -> Vec { } } - if let Some(ref orgs) = ecosystem.github_organizations { - if !orgs.is_empty() { - has_orgs = true; - } - } - if let Some(ref repos) = ecosystem.repo { - if !repos.is_empty() { - has_repos = true; - } for repo in repos { let lowercase_url = repo.url.to_lowercase(); if seen_repos.contains(&lowercase_url) { @@ -182,13 +162,9 @@ fn validate_ecosystems(ecosystem_map: &EcosystemMap) -> Vec { } } } - - if !(has_sub_ecosystems || has_orgs || has_repos) { - errors.push(ValidationError::EmptyEcosystem(ecosystem.title.clone())); - } } - if errors.is_empty() { + if errors.len() == 0 { println!( "Validated {} ecosystems and {} repos ({} missing)", ecosystem_map.len(),