Merge branch 'main' into patch-7

This commit is contained in:
Takayuki Maeda 2021-06-29 13:24:08 +09:00 committed by GitHub
commit 41b4fe6581
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 100 additions and 27 deletions

1
.github/FUNDING.yml vendored
View file

@ -1 +1,2 @@
github: TaKO8Ki
custom: https://stakes.social/0xC65ca20B670aa65fDd05DEBAFBF02D3387F316Cd

View file

@ -1,5 +1,5 @@
# Awesome Alternatives in Rust
[![github workflow status](https://img.shields.io/github/workflow/status/TaKO8Ki/awesome-alternatives-in-rust/CI/main)](https://github.com/TaKO8Ki/awesome-alternatives-in-rust/actions)
[![github workflow status](https://img.shields.io/github/workflow/status/TaKO8Ki/awesome-alternatives-in-rust/CI/main)](https://github.com/TaKO8Ki/awesome-alternatives-in-rust/actions) [![stakes.social](https://badge.devprotocol.xyz/0xC65ca20B670aa65fDd05DEBAFBF02D3387F316Cd/descriptive)](https://stakes.social/0xC65ca20B670aa65fDd05DEBAFBF02D3387F316Cd)
A curated list of replacements for existing software written in Rust.
@ -11,14 +11,19 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
- [Applications](#applications)
- [Container](#container)
- [Games](#games)
- [Performance](#performance)
- [System tools](#system-tools)
- [Terminal](#terminal)
- [Text editors](#text-editors)
- [Text processing](#text-processing)
- [Utilities](#utilities)
- [Web](#web)
- [Development tools](#development-tools)
- [Command runners](#command-runners)
- [Linters](#linters)
- [Libraries](#libraries)
- [Email](#email)
## Applications
@ -26,7 +31,19 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
#### [runc](https://github.com/opencontainers/runc)
* [youki](https://github.com/utam0k/youki) - An experimental container runtime written in Rust
* [youki](https://github.com/containers/youki) - An experimental container runtime written in Rust
### Games
#### [Stockfish](https://github.com/official-stockfish/Stockfish/)
* [Pleco](https://github.com/sfleischman105/Pleco) - A Rust-based re-write of the Stockfish Chess Engine
### Performance
#### [jMeter](https://github.com/apache/jmeter)
* [drill](https://github.com/fcsonline/drill) - A HTTP load testing application written in Rust
### System tools
@ -42,6 +59,11 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
* [nushell](https://github.com/nushell/nushell/) - An attractive structured shell
#### bc
* [cpc](https://github.com/probablykasper/cpc) - Text calculator with support for units and conversion
* [eva](https://github.com/NerdyPepper/eva) - a calculator REPL, similar to bc(1)
#### cat
* [bat](https://github.com/sharkdp/bat) - A cat(1) clone with wings.
@ -51,10 +73,26 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
* [loc](https://github.com/cgag/loc) - Count lines of code quickly.
* [tokei](https://github.com/XAMPPRocky/tokei) - Count your code, quickly.
#### [coreboot](https://github.com/coreboot/coreboot)
* [oreboot](https://github.com/oreboot/oreboot) - oreboot is a fork of coreboot, with C removed, written in Rust.
#### cp
* [xcp](https://github.com/tarka/xcp) - An extended `cp`
#### cut
* [choose](https://github.com/theryangeary/choose) - A human-friendly and fast alternative to cut and (sometimes) awk
#### diff
* [delta](https://github.com/dandavison/delta) - A viewer for git and diff output
#### dig
* [dog](https://github.com/ogham/dog) - A command-line DNS client.
#### du
* [dua](https://github.com/Byron/dua-cli) - View disk space usage and delete unwanted data, fast.
@ -99,6 +137,10 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
* [frum](https://github.com/TaKO8Ki/frum) - A little bit fast and modern Ruby version manager written in Rust
#### rename
* [rnr](https://github.com/ChuckDaniels87/rnr) - A command-line tool to batch rename files and directories
#### rm
* [rip](https://github.com/nivekuil/rip) - A safe and ergonomic alternative to rm
@ -130,16 +172,28 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
* [bottom](https://github.com/ClementTsang/bottom) - Yet another cross-platform graphical process/system monitor.
* [ytop](https://github.com/cjbassi/ytop) (no longer maintained) - A TUI system monitor written in Rust
#### uniq
* [huniq](https://github.com/koraa/huniq) - Filter out duplicates on the command line.
#### [yay](https://github.com/Jguer/yay)
* [paru](https://github.com/Morganamilo/paru) - Feature packed AUR helper
### Terminal
#### [tmux](https://github.com/tmux/tmux)
#### [Spaceship](https://github.com/spaceship-prompt/spaceship-prompt)
* [Zellij](https://github.com/zellij-org/zellij) - A terminal workspace with batteries included
* [starship](https://github.com/starship/starship) - ☄️🌌 The minimal, blazing-fast, and infinitely customizable prompt for any shell!
#### [termite](https://github.com/thestinger/termite)
* [Alacritty](https://github.com/alacritty/alacritty) - A cross-platform, OpenGL terminal emulator.
#### [tmux](https://github.com/tmux/tmux)
* [Zellij](https://github.com/zellij-org/zellij) - A terminal workspace with batteries included
### Text editors
#### Vim
@ -154,7 +208,7 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
### Utilities
#### [codemod](https://github.com/facebook/codemod)
#### [codemod](https://github.com/facebookarchive/codemod)
* [fastmod](https://github.com/facebookincubator/fastmod) - A fast partial replacement for the codemod tool
@ -166,10 +220,22 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
* [gitui](https://github.com/extrawurst/gitui) - Blazing fast terminal-ui for git written in Rust 🦀
### Web
#### [Reddit](https://www.reddit.com/)
* [Lemmy](https://github.com/LemmyNet/lemmy) - 🐀 Building a federated alternative to reddit in rust
#### [teddit](https://codeberg.org/teddit/teddit)
* [libreddit](https://github.com/spikecodes/libreddit) - Private front-end for Reddit written in Rust
## Development tools
### Command runners
#### make
* [just](https://github.com/casey/just) - A command runner and partial replacement for `make`
### Linters
@ -182,3 +248,11 @@ I renamed the repository to "Awesome Alternatives in Rust". The original name wa
#### [ShellCheck](https://github.com/koalaman/shellcheck)
* [Shellharden](https://github.com/anordal/shellharden) - The corrective bash syntax highlighter
## Libraries
### Email
#### [mjml](https://github.com/mjmlio/mjml)
* [mrml](https://github.com/jdrouet/mrml) - Blazing fast reimplementation of mjml in Rust (~200x faster)

View file

@ -183,7 +183,7 @@ fn get_url_core(url: String) -> BoxFuture<'static, (String, Result<(), CheckerEr
warn!("Error while getting {}, retrying: {}", url, status);
if status.is_redirection() {
res = Err(CheckerError::HttpError {status: status.as_u16(), location: ok.headers().get(header::LOCATION).and_then(|h| h.to_str().ok()).map(|x| x.to_string())});
res = Err(CheckerError::HttpError {status: status.as_u16(), location: ok.headers().get(header::LOCATION).and_then(|h| h.to_str().map(|x| x.to_string()).ok())});
break;
} else {
res = Err(CheckerError::HttpError {status: status.as_u16(), location: None});
@ -202,16 +202,16 @@ fn get_url_core(url: String) -> BoxFuture<'static, (String, Result<(), CheckerEr
res = Err(CheckerError::TravisBuildUnknown);
break;
}
let query = matches.get(1).map(|x| x.as_str()).unwrap_or("");
if !query.starts_with("?") || query.find("branch=").is_none() {
let query = matches.get(1).map(|x| x.as_str()).unwrap_or_default();
if !query.starts_with('?') || query.contains("branch=") {
res = Err(CheckerError::TravisBuildNoBranch);
break;
}
}
if let Some(matches) = GITHUB_ACTIONS_REGEX.captures(&url) {
debug!("Github actions match {:?}", matches);
let query = matches.get(1).map(|x| x.as_str()).unwrap_or("");
if !query.starts_with("?") || query.find("branch=").is_none() {
let query = matches.get(1).map(|x| x.as_str()).unwrap_or_default();
if !query.starts_with('?') || query.contains("branch=") {
res = Err(CheckerError::GithubActionNoBranch);
break;
}
@ -251,27 +251,26 @@ async fn main() -> Result<(), Error> {
let mut results: Results = fs::read_to_string("results/results.yml")
.map_err(|e| format_err!("{}", e))
.and_then(|x| serde_yaml::from_str(&x).map_err(|e| format_err!("{}", e)))
.unwrap_or(Results::new());
.unwrap_or_default();
let mut url_checks = vec![];
let min_between_checks: Duration = Duration::days(3);
let max_allowed_failed: Duration = Duration::days(7);
let mut do_check = |url: String| {
if !url.starts_with("http") {
return;
}
used.insert(url.clone());
if let Some(link) = results.get(&url) {
if let Working::Yes = link.working {
let since = Local::now() - link.updated_at;
if since < min_between_checks {
return;
if url.starts_with("http") {
used.insert(url.clone());
if let Some(link) = results.get(&url) {
if let Working::Yes = link.working {
let since = Local::now() - link.updated_at;
if since < min_between_checks {
return;
}
}
}
let check = get_url(url).boxed();
url_checks.push(check);
}
let check = get_url(url).boxed();
url_checks.push(check);
};
for (event, _) in parser.into_offset_iter() {
@ -292,7 +291,7 @@ async fn main() -> Result<(), Error> {
}
}
let results_keys = results.keys().cloned().collect::<BTreeSet<String>>();
let results_keys: BTreeSet<String> = results.keys().cloned().collect();
let old_links = results_keys.difference(&used);
for link in old_links {
results.remove(link).unwrap();
@ -301,7 +300,7 @@ async fn main() -> Result<(), Error> {
let mut not_written = 0;
let mut last_written = Local::now();
while url_checks.len() > 0 {
while !url_checks.is_empty() {
debug!("Waiting for {}", url_checks.len());
let ((url, res), _index, remaining) = select_all(url_checks).await;
url_checks = remaining;
@ -351,7 +350,7 @@ async fn main() -> Result<(), Error> {
}
}
fs::write("results/results.yml", serde_yaml::to_string(&results)?)?;
println!("");
println!();
let mut failed: u32 = 0;
for (url, link) in results.iter() {
@ -386,8 +385,7 @@ async fn main() -> Result<(), Error> {
}
}
if failed == 0 {
println!("No errors!");
Ok(())
Ok(println!("No errors!"))
} else {
Err(format_err!("{} urls with errors", failed))
}