1
0
mirror of https://github.com/rust-unofficial/awesome-rust.git synced 2024-12-12 19:18:26 +02:00

Merge pull request #1672 from joshka/cleaup-readme

Cleanup README and add linter for formatting!
This commit is contained in:
Tom Parker-Shemilt 2024-06-02 12:44:33 +01:00 committed by GitHub
commit 14e70b36a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 335 additions and 329 deletions

View File

@ -4,9 +4,15 @@ Do you want to contribute? We'd love that.
Our goal is to have mostly projects that are stable and useful to many users. Our goal is to have mostly projects that are stable and useful to many users.
## TL;DR
- Accepted: `(stars > 50 | downloads > 2000)`
- Template: `[ACCOUNT/REPO](https://github.com/ACCOUNT/REPO) [[CRATE](https://crates.io/crates/CRATE)] — DESCRIPTION`
- Sort: alphabetical
## How? ## How?
The easiest way is to go to https://github.com/rust-unofficial/awesome-rust/blob/main/README.md and click on the "pen" icon in the upper right corner. Make the changes to the file and follow the instructions to create a pull request. The easiest way is to go to <https://github.com/rust-unofficial/awesome-rust/blob/main/README.md> and click on the "pen" icon in the upper right corner. Make the changes to the file and follow the instructions to create a pull request.
If you want to add an entry to the `README.md` please consider this: If you want to add an entry to the `README.md` please consider this:

649
README.md

File diff suppressed because it is too large Load Diff

View File

@ -171,7 +171,7 @@ async fn main() -> Result<(), Error> {
return; return;
} }
used.insert(url.clone()); used.insert(url.clone());
if results.get(&url).is_some() { if results.contains_key(&url) {
return; return;
} }
let check = get_hacktoberfest(url).boxed(); let check = get_hacktoberfest(url).boxed();

View File

@ -174,6 +174,8 @@ lazy_static! {
static ref GITHUB_API_REGEX: Regex = Regex::new(r"https://api.github.com/").unwrap(); static ref GITHUB_API_REGEX: Regex = Regex::new(r"https://api.github.com/").unwrap();
static ref CRATE_REGEX: Regex = static ref CRATE_REGEX: Regex =
Regex::new(r"https://crates.io/crates/(?P<crate>[^/]+)/?$").unwrap(); Regex::new(r"https://crates.io/crates/(?P<crate>[^/]+)/?$").unwrap();
static ref ITEM_REGEX: Regex =
Regex::new(r"(?P<repo>(\S+)(/\S+)?)(?P<crate> \[\S*\])? — (?P<desc>\S.+)").unwrap();
} }
#[derive(Deserialize, Debug)] #[derive(Deserialize, Debug)]
@ -581,6 +583,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)); 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) {
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()); list_items.last_mut().unwrap().data.push(list_item.clone());
list_item = String::new(); list_item = String::new();
} }