From df37784ad7837fe2a1563ded84c260ec1d59781d Mon Sep 17 00:00:00 2001 From: "hinto.janai" Date: Thu, 1 Jun 2023 09:07:06 -0400 Subject: [PATCH] add `typo.yml` --- .github/workflows/typo.yml | 22 ++++++++++++++++++++++ README.md | 6 +++--- external/README.md | 2 +- src/README.md | 2 +- src/constants.rs | 4 ++-- src/disk.rs | 2 +- src/helper.rs | 10 +++++----- src/main.rs | 6 +++--- typos.toml | 5 +++++ 9 files changed, 43 insertions(+), 16 deletions(-) create mode 100644 .github/workflows/typo.yml create mode 100644 typos.toml diff --git a/.github/workflows/typo.yml b/.github/workflows/typo.yml new file mode 100644 index 0000000..7b00ad6 --- /dev/null +++ b/.github/workflows/typo.yml @@ -0,0 +1,22 @@ +# This catches typos. + +name: Typo + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +env: + CARGO_TERM_COLOR: always + RUST_BACKTRACE: "full" + +jobs: + typo: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Spell Check + uses: crate-ci/typos@master diff --git a/README.md b/README.md index 6d47e09..c136c3d 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Gupax is a GUI for mining [**Monero**](https://github.com/monero-project/monero) [**`P2Pool`**](https://github.com/SChernykh/p2pool) allows you to create/join decentralized peer-to-peer Monero mining pools. -P2Pool as a concept was [first developed for Bitcoin](https://en.bitcoin.it/wiki/P2Pool) although [failed to stay relevent for various reasons](https://github.com/p2pool/p2pool). +P2Pool as a concept was [first developed for Bitcoin](https://en.bitcoin.it/wiki/P2Pool) although [failed to stay relevant for various reasons](https://github.com/p2pool/p2pool). In late 2021, [`SChernykh`](https://github.com/SChernykh) rewrote P2Pool from scratch for Monero. @@ -83,7 +83,7 @@ Both Monero and P2Pool have built in miners but XMRig is quite faster than both **`XMRig`** mines to **`P2Pool`** -**`P2Pool`** fetchs blocks from a **`Monero node`** +**`P2Pool`** fetches blocks from a **`Monero node`** **`Monero GUI`** runs the **`Monero node`** @@ -699,7 +699,7 @@ Although Gupax uses a temporary folder (`gupax_update_[A-Za-z0-9]`) to store tem ### Bundled vs Standalone `Bundled` Gupax comes with the latest version of P2Pool/XMRig already in the `zip/tar`. -`Standlone` only contains the Gupax executable. +`Standalone` only contains the Gupax executable. --- diff --git a/external/README.md b/external/README.md index 06ffabc..00ca976 100644 --- a/external/README.md +++ b/external/README.md @@ -3,4 +3,4 @@ These are some external git repositories for various purposes: | Repo | Purpose | |------|---------------------| | egui | [external/egui/crates/eframe/src/native/run.rs] line 41: [.with_srgb(true)]. This line causes a [panic!] inside a Windows VM, from a Linux host. The only change is [.with_srgb()] is set to [false]. This is only used for testing, since ironically, this crashes bare-metal Windows. | -| rust-runas | This contains some interesting code that could be used as an alternative to running proccesses with elevated privilege in Windows for Gupax | +| rust-runas | This contains some interesting code that could be used as an alternative to running processes with elevated privilege in Windows for Gupax | diff --git a/src/README.md b/src/README.md index d74af1d..f7961d4 100644 --- a/src/README.md +++ b/src/README.md @@ -71,7 +71,7 @@ This is how Gupax works internally when starting up: - Kill processes, kill connections, exit ## Scale -Every frame, the max available `[width, height]` are calculated, and those are used as a baseline for the Top/Bottom bars, containing the tabs and status bar. After that, all available space is given to the middle ui elements. The scale is calculated every frame so that all elements can scale immediately as the user adjusts it; this doesn't take as much CPU as you might think since frames are only rendered on user interaction. Some elements are subtracted a fixed number because the `ui.seperator()`'s add some fixed space which needs to be accounted for. +Every frame, the max available `[width, height]` are calculated, and those are used as a baseline for the Top/Bottom bars, containing the tabs and status bar. After that, all available space is given to the middle ui elements. The scale is calculated every frame so that all elements can scale immediately as the user adjusts it; this doesn't take as much CPU as you might think since frames are only rendered on user interaction. Some elements are subtracted a fixed number because the `ui.separator()`'s add some fixed space which needs to be accounted for. ``` Main [App] outer frame (default: [1280.0, 960.0], 4:3 aspect ratio) diff --git a/src/constants.rs b/src/constants.rs index fa1982e..e9e0644 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -120,7 +120,7 @@ pub const DARK_GRAY: egui::Color32 = egui::Color32::from_gray(13); // [Duration] constants pub const SECOND: std::time::Duration = std::time::Duration::from_secs(1); -// The explaination given to the user on why XMRig needs sudo. +// The explanation given to the user on why XMRig needs sudo. pub const XMRIG_ADMIN_REASON: &str = r#"The large hashrate difference between XMRig and other miners like Monero and P2Pool's built-in miners is mostly due to XMRig configuring CPU MSRs and setting up hugepages. Other miners like Monero or P2Pool's built-in miner do not do this. It can be done manually but it isn't recommended since XMRig does this for you automatically, but only if it has the proper admin privileges."#; // Password buttons @@ -342,7 +342,7 @@ pub const XMRIG_ARGUMENTS: &str = r#"WARNING: Use [--no-color] and make sure to set [--http-host ] & [--http-port ] so that the [Status] tab can work! Start XMRig with these arguments and override all below settings"#; -pub const XMRIG_ADDRESS: &str = "Specify which Monero address to payout to. This does nothing if mining to P2Pool since the address being payed out to will be the one P2Pool started with. This doubles as a rig identifier for P2Pool and some pools."; +pub const XMRIG_ADDRESS: &str = "Specify which Monero address to payout to. This does nothing if mining to P2Pool since the address being paid out to will be the one P2Pool started with. This doubles as a rig identifier for P2Pool and some pools."; pub const XMRIG_NAME: &str = "Add a unique name to identify this pool; Only [A-Za-z0-9-_.] and spaces allowed; Max length = 30 characters"; pub const XMRIG_IP: &str = "Specify the pool IP to connect to with XMRig; It must be a valid IPv4 address or a valid domain name; Max length = 255 characters"; pub const XMRIG_PORT: &str = "Specify the port of the pool; [1-65535]"; diff --git a/src/disk.rs b/src/disk.rs index 8a4c797..6d2b114 100644 --- a/src/disk.rs +++ b/src/disk.rs @@ -255,7 +255,7 @@ impl State { } } - // Conver [State] to [String] + // Convert [State] to [String] pub fn to_string(&self) -> Result { match toml::ser::to_string(self) { Ok(s) => Ok(s), diff --git a/src/helper.rs b/src/helper.rs index 069eca1..9b07061 100644 --- a/src/helper.rs +++ b/src/helper.rs @@ -419,7 +419,7 @@ impl Helper { } else { // Overriding command arguments if !state.arguments.is_empty() { - // This parses the input and attemps to fill out + // This parses the input and attempts to fill out // the [ImgP2pool]... This is pretty bad code... let mut last = ""; let lock = lock!(helper); @@ -813,7 +813,7 @@ impl Helper { } else { // Overriding command arguments if !state.arguments.is_empty() { - // This parses the input and attemps to fill out + // This parses the input and attempts to fill out // the [ImgXmrig]... This is pretty bad code... let mut last = ""; let lock = lock!(helper); @@ -1122,8 +1122,8 @@ impl Helper { // // GUI Main -> locks [p2pool] first // Helper -> locks [gui_api_p2pool] first - // GUI Status Tab -> trys to lock [gui_api_p2pool] -> CAN'T - // Helper -> trys to lock [p2pool] -> CAN'T + // GUI Status Tab -> tries to lock [gui_api_p2pool] -> CAN'T + // Helper -> tries to lock [p2pool] -> CAN'T // // These two threads are now in a deadlock because both // are trying to access locks the other one already has. @@ -1302,7 +1302,7 @@ pub struct PubP2poolApi { pub p2pool_difficulty: HumanNumber, pub p2pool_hashrate: HumanNumber, pub miners: HumanNumber, // Current amount of miners on P2Pool sidechain - // Mean (calcualted in functions, not serialized) + // Mean (calculated in functions, not serialized) pub solo_block_mean: HumanTime, // Time it would take the user to find a solo block pub p2pool_block_mean: HumanTime, // Time it takes the P2Pool sidechain to find a block pub p2pool_share_mean: HumanTime, // Time it would take the user to find a P2Pool share diff --git a/src/main.rs b/src/main.rs index 7bb5031..788bf47 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1246,7 +1246,7 @@ impl eframe::App for App { // This is separate from the [self.width != available_width] logic above // because placing [init_text_styles()] above would mean calling it 60x a second // while the user was readjusting the frame. It's a pretty heavy operation and looks - // buggy when calling it that many times. Looking for a [must_resize] in addtion to + // buggy when calling it that many times. Looking for a [must_resize] in addition to // checking if the user is hovering over the app means that we only have call it once. debug!("App | Checking if we need to resize"); if self.must_resize && ctx.is_pointer_over_area() { @@ -1329,9 +1329,9 @@ impl eframe::App for App { ui.add_sized([width, height], Label::new("Reset the manual node list?")) }, ErrorButtons::Sudo => { - let text = format!("Why does XMRig need admin priviledge?\n{}", XMRIG_ADMIN_REASON); + let text = format!("Why does XMRig need admin privilege?\n{}", XMRIG_ADMIN_REASON); let height = height/4.0; - ui.add_sized([width, height], Label::new(format!("--- Gupax needs sudo/admin priviledge for XMRig! ---\n{}", &self.error_state.msg))); + ui.add_sized([width, height], Label::new(format!("--- Gupax needs sudo/admin privilege for XMRig! ---\n{}", &self.error_state.msg))); ui.style_mut().override_text_style = Some(Name("MonospaceSmall".into())); ui.add_sized([width/2.0, height], Label::new(text)); ui.add_sized([width, height], Hyperlink::from_label_and_url("Click here for more info.", "https://xmrig.com/docs/miner/randomx-optimization-guide")) diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000..096e6ef --- /dev/null +++ b/typos.toml @@ -0,0 +1,5 @@ +[files] +extend-exclude = [ + "src/cpu.json", + "pgp/", +]