From 28b0b490f93fe9f7964d0593b9ba600f4b24663e Mon Sep 17 00:00:00 2001 From: Yaroslav Halchenko Date: Fri, 5 Apr 2024 16:51:57 +0200 Subject: chore(ci): Add codespell support (config, workflow) and make it fix some typos (#1916) * Add github action to codespell main on push and PRs * Add rudimentary codespell config * ignore crate, inbetween etc * [DATALAD RUNCMD] run codespell throughout fixing typo automagically but ignoring the failure due to ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w || :", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ * [DATALAD RUNCMD] Do interactive fixing of leftover ambigous typos === Do not change lines below === { "chain": [], "cmd": "codespell -w -i 3 -C 2", "exit": 0, "extra_inputs": [], "inputs": [], "outputs": [], "pwd": "." } ^^^ Do not change lines above ^^^ --- .codespellrc | 7 +++++++ .github/workflows/codespell.yml | 23 +++++++++++++++++++++++ CHANGELOG.md | 8 ++++---- atuin-client/src/record/encryption.rs | 2 +- atuin-client/src/record/sqlite_store.rs | 6 +++--- atuin-client/src/record/store.rs | 2 +- atuin-client/src/record/sync.rs | 2 +- atuin-server/src/handlers/mod.rs | 2 +- atuin/src/command/client/search/engines/skim.rs | 2 +- atuin/src/command/gen_completions.rs | 4 ++-- 10 files changed, 44 insertions(+), 14 deletions(-) create mode 100644 .codespellrc create mode 100644 .github/workflows/codespell.yml diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 00000000..8f9ed850 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,7 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.lock,.codespellrc +check-hidden = true +# ignore-regex = +ignore-words-list = crate,ratatui,inbetween + diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 00000000..7c9eafb1 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,23 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/CHANGELOG.md b/CHANGELOG.md index bf5dbc7a..96ca33a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,7 +16,7 @@ All notable changes to this project will be documented in this file. - Ensure sync time is saved for sync v2 ([#1758](https://github.com/atuinsh/atuin/issues/1758)) - No panic on empty inspector ([#1768](https://github.com/atuinsh/atuin/issues/1768)) - Enable multiple command stats to be shown using unicode_segmentation ([#1739](https://github.com/atuinsh/atuin/issues/1739)) -- Readd up-arrow keybinding, now with menu handling ([#1770](https://github.com/atuinsh/atuin/issues/1770)) +- Re-add up-arrow keybinding, now with menu handling ([#1770](https://github.com/atuinsh/atuin/issues/1770)) - Missing characters in preview ([#1803](https://github.com/atuinsh/atuin/issues/1803)) - Check store length after sync, not before ([#1805](https://github.com/atuinsh/atuin/issues/1805)) - Disable regex error logs ([#1806](https://github.com/atuinsh/atuin/issues/1806)) @@ -277,7 +277,7 @@ All notable changes to this project will be documented in this file. - Make `atuin account delete` void session + key ([#1393](https://github.com/atuinsh/atuin/issues/1393)) - New clippy lints ([#1395](https://github.com/atuinsh/atuin/issues/1395)) - Accept multiline commands ([#1418](https://github.com/atuinsh/atuin/issues/1418)) -- Reenable enter_accept for bash ([#1408](https://github.com/atuinsh/atuin/issues/1408)) +- Re-enable enter_accept for bash ([#1408](https://github.com/atuinsh/atuin/issues/1408)) - Respect ZSH's $ZDOTDIR environment variable ([#942](https://github.com/atuinsh/atuin/issues/942)) ### Documentation @@ -354,7 +354,7 @@ All notable changes to this project will be documented in this file. ### Features -- Do not allow empty passwords durring account creation ([#1029](https://github.com/atuinsh/atuin/issues/1029)) +- Do not allow empty passwords during account creation ([#1029](https://github.com/atuinsh/atuin/issues/1029)) ### Skim @@ -441,7 +441,7 @@ All notable changes to this project will be documented in this file. ### Miscellaneous Tasks -- Allow specifiying the limited of returned entries ([#364](https://github.com/atuinsh/atuin/issues/364)) +- Allow specifying the limited of returned entries ([#364](https://github.com/atuinsh/atuin/issues/364)) ## [0.9.0] - 2022-04-23 diff --git a/atuin-client/src/record/encryption.rs b/atuin-client/src/record/encryption.rs index ca49660c..3ad3be66 100644 --- a/atuin-client/src/record/encryption.rs +++ b/atuin-client/src/record/encryption.rs @@ -36,7 +36,7 @@ See - - -Why would we care? In the past we have recieved some requests for company solutions. If in future we can configure a +Why would we care? In the past we have received some requests for company solutions. If in future we can configure a KMS service with little effort, then that would solve a lot of issues for their security team. Even for personal use, if a user is not comfortable with sharing keys between hosts, diff --git a/atuin-client/src/record/sqlite_store.rs b/atuin-client/src/record/sqlite_store.rs index 6333bb27..e17893eb 100644 --- a/atuin-client/src/record/sqlite_store.rs +++ b/atuin-client/src/record/sqlite_store.rs @@ -171,7 +171,7 @@ impl Store for SqliteStore { match res { Err(sqlx::Error::RowNotFound) => Ok(None), - Err(e) => Err(eyre!("an error occured: {}", e)), + Err(e) => Err(eyre!("an error occurred: {}", e)), Ok(record) => Ok(Some(record)), } } @@ -238,7 +238,7 @@ impl Store for SqliteStore { match res { Err(sqlx::Error::RowNotFound) => Ok(None), - Err(e) => Err(eyre!("an error occured: {}", e)), + Err(e) => Err(eyre!("an error occurred: {}", e)), Ok(v) => Ok(Some(v)), } } @@ -603,7 +603,7 @@ mod tests { // reencrypt the store, then check if // 1) it cannot be decrypted with the old key - // 2) it can be decrypted wiht the new key + // 2) it can be decrypted with the new key let (new_key, _) = generate_encoded_key().unwrap(); store diff --git a/atuin-client/src/record/store.rs b/atuin-client/src/record/store.rs index ae8ea356..188e18ce 100644 --- a/atuin-client/src/record/store.rs +++ b/atuin-client/src/record/store.rs @@ -5,7 +5,7 @@ use atuin_common::record::{EncryptedData, HostId, Record, RecordId, RecordIdx, R /// A record store stores records /// In more detail - we tend to need to process this into _another_ format to actually query it. -/// As is, the record store is intended as the source of truth for arbitratry data, which could +/// As is, the record store is intended as the source of truth for arbitrary data, which could /// be shell history, kvs, etc. #[async_trait] pub trait Store { diff --git a/atuin-client/src/record/sync.rs b/atuin-client/src/record/sync.rs index 02c53d44..234c6442 100644 --- a/atuin-client/src/record/sync.rs +++ b/atuin-client/src/record/sync.rs @@ -15,7 +15,7 @@ pub enum SyncError { #[error("the local store is ahead of the remote, but for another host. has remote lost data?")] LocalAheadOtherHost, - #[error("an issue with the local database occured: {msg:?}")] + #[error("an issue with the local database occurred: {msg:?}")] LocalStoreError { msg: String }, #[error("something has gone wrong with the sync logic: {msg:?}")] diff --git a/atuin-server/src/handlers/mod.rs b/atuin-server/src/handlers/mod.rs index a10e622d..50f82336 100644 --- a/atuin-server/src/handlers/mod.rs +++ b/atuin-server/src/handlers/mod.rs @@ -16,7 +16,7 @@ pub async fn index(state: State>) -> Json score { ranks.insert(i, score); set.insert(i, history.clone()); diff --git a/atuin/src/command/gen_completions.rs b/atuin/src/command/gen_completions.rs index 91b1b66f..2872a58a 100644 --- a/atuin/src/command/gen_completions.rs +++ b/atuin/src/command/gen_completions.rs @@ -3,8 +3,8 @@ use clap_complete::{generate, generate_to, Generator, Shell}; use clap_complete_nushell::Nushell; use eyre::Result; -// clap put nushell completions into a seperate package due to the maintainers -// being a little less commited to support them. +// clap put nushell completions into a separate package due to the maintainers +// being a little less committed to support them. // This means we have to do a tiny bit of legwork to combine these completions // into one command. #[derive(Debug, Clone, ValueEnum)] -- cgit v1.3.1