8000 Add codespell support (config, workflow) and make it fix some typos by yarikoptic · Pull Request #1916 · atuinsh/atuin · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add codespell support (config, workflow) and make it fix some typos #1916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .codespellrc
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions .github/workflows/codespell.yml
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion atuin-client/src/record/encryption.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions atuin-client/src/record/sqlite_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
}
Expand Down Expand Up @@ -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)),
}
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion atuin-client/src/record/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion atuin-client/src/record/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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:?}")]
Expand Down
2 changes: 1 addition & 1 deletion atuin-server/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion atuin/src/command/client/search/engines/skim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions atuin/src/command/gen_completions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
0