Add warning about bad hyphens

This commit is contained in:
Tom Parker-Shemilt 2024-08-03 15:52:10 +01:00
parent abf2de763f
commit 06f16fa491

View file

@ -584,6 +584,9 @@ async fn main() -> Result<(), Error> {
return Err(format_err!("Not high enough metrics ({:?} stars < {}, and {:?} cargo downloads < {}): {}", github_stars, required_stars, cargo_downloads, MINIMUM_CARGO_DOWNLOADS, list_item));
}
if link_count > 0 && !ITEM_REGEX.is_match(&list_item) {
if list_item.contains("") {
warn!("\"{list_item}\" uses a '—' hyphen, not the '-' hyphen and we enforce the use of the latter one");
}
return Err(format_err!("Item does not match the template: \"{list_item}\". See https://github.com/rust-unofficial/awesome-rust/blob/main/CONTRIBUTING.md#tldr"));
}
list_items.last_mut().unwrap().data.push(list_item.clone());