Skip to content

Commit

Permalink
refactor: fix typos with typos-cli
Browse files Browse the repository at this point in the history
I never knew I had many typos until I tried typos-cli by @epage.
All of them are valid typos; there are no false positives.
I will definitely embrace it in all my codebases.
  • Loading branch information
azzamsa committed Dec 8, 2023
1 parent ceb852d commit 443bc28
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ jobs:

- uses: taiki-e/install-action@just
- uses: taiki-e/install-action@dprint
- uses: taiki-e/install-action@v2

This comment has been minimized.

Copy link
@epage

epage Dec 8, 2023

This comment has been minimized.

Copy link
@azzamsa

azzamsa Dec 8, 2023

Author Owner

:), Yes I am aware of this. Just to make things somewhat consistent.

with:
tool: typos-cli

- name: Check MSRV
run: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ When you use this template, try to follow the checklist to update your info prop
- [ ] Change the author name in `LICENSE`
- [ ] Change the package info in `Cargo.toml`
- [ ] Change the application name:
- [ ] Database name and other values in `.env`, `.example.env`, and other containr related files.
- [ ] Database name and other values in `.env`, `.example.env`, and other container related files.
- [ ] The OpenAPI info in `routes.rs`
- [ ] App name in `release.yml`
- [ ] Project URL in `cliff.toml`
Expand Down
6 changes: 6 additions & 0 deletions configs/typos.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[files]
extend-exclude = ["CHANGELOG.md"]

[default.extend-words]
# [RFC 4122 - A Universally Unique IDentifier (UUID) URN Namespace](https://datatracker.ietf.org/doc/html/rfc4122)
Dentifier = "Dentifier"
3 changes: 2 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ _default:

# Setup the repository.
setup: _areyousure
just _cargo-install 'cargo-edit cargo-nextest cargo-outdated dprint git-cliff bacon'
just _cargo-install 'cargo-edit cargo-nextest cargo-outdated dprint git-cliff bacon typos-cli'
just _cargo-install 'sqlx-cli'

# Tasks to make the code-base comply with the rules. Mostly used in git hooks.
Expand Down Expand Up @@ -61,6 +61,7 @@ fmt-check:
# Lint the codebase.
lint:
cargo clippy --all-targets --all-features
typos --config configs/typos.toml

# Test the codebase.
test:
Expand Down
2 changes: 1 addition & 1 deletion src/domain/health/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ impl HealthQuery {
}
}

/// Test server health wihout invoking many
/// Test server health without invoking many
/// moving parts.
#[utoipa::path(
get,
Expand Down
2 changes: 1 addition & 1 deletion src/error/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ impl std::convert::From<Error> for crate::Error {
impl std::convert::From<sqlx::Error> for Error {
fn from(err: sqlx::Error) -> Self {
match err {
// Not found error should be catched manually
// Not found error should be caught manually
_ => Error::Internal,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/relay/validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
relay::Base64Cursor,
};

/// Parse `after` and `befor` to cursor
/// Parse `after` and `before` to cursor
pub fn convert_params(
after: Option<String>,
before: Option<String>,
Expand Down
2 changes: 1 addition & 1 deletion tests/user/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub struct DeleteUserResponse {
#[derive(Debug, Deserialize)]
#[serde(rename_all(deserialize = "camelCase"))]
pub struct DeleteUserWrapper {
pub delte_user: User,
pub delete_user: User,
}

//
Expand Down

0 comments on commit 443bc28

Please sign in to comment.