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 ^^^
This commit is contained in:
Yaroslav Halchenko 2024-04-05 16:51:57 +02:00 committed by GitHub
parent 894eaa6faf
commit 28b0b490f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 44 additions and 14 deletions

7
.codespellrc Normal file
View File

@ -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

23
.github/workflows/codespell.yml vendored Normal file
View File

@ -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

View File

@ -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

View File

@ -36,7 +36,7 @@ See
- <https://www.yubico.com/gb/product/yubihsm-2-fips/>
- <https://cheatsheetseries.owasp.org/cheatsheets/Cryptographic_Storage_Cheat_Sheet.html#encrypting-stored-keys>
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,

View File

@ -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

View File

@ -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 {

View File

@ -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:?}")]

View File

@ -16,7 +16,7 @@ pub async fn index<DB: Database>(state: State<AppState<DB>>) -> Json<IndexRespon
let homage = r#""Through the fathomless deeps of space swims the star turtle Great A'Tuin, bearing on its back the four giant elephants who carry on their shoulders the mass of the Discworld." -- Sir Terry Pratchett"#;
// Error with a -1 response
// It's super unlikley this will happen
// It's super unlikely this will happen
let count = state.database.total_history().await.unwrap_or(-1);
Json(IndexResponse {

View File

@ -107,7 +107,7 @@ async fn fuzzy_search(
// 1. find either the position that this command ranks
// 2. find the same command positioned better than our rank.
for i in 0..set.len() {
// do we out score the corrent position?
// do we out score the current position?
if ranks[i] > score {
ranks.insert(i, score);
set.insert(i, history.clone());

View File

@ -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)]