From 2321eb971c2b89551506e2016a3495fafd15b47d Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Wed, 22 Mar 2023 14:53:25 +0100 Subject: [PATCH] Correct more typos with `typos` tool. The initial configuration still has a few problems: after basic configuration via `_typos.toml` that excludes changelogs and fixtures it's down to just a couple of typos, many of which are false positives due to language, hashes or signatures which contain two-letter sequences that it wants to correct. Especially with hashes I find it hard to teach it what to do as I want the whole file to be checked without allowing bogus words in an extended dictionary. --- _typos.toml | 6 ++++++ gix-config/src/file/access/raw.rs | 2 +- gix-revision/tests/spec/parse/anchor/refnames.rs | 2 +- gix-tempfile/tests/tempfile/fs/create_dir.rs | 2 +- gix-transport/src/client/blocking_io/http/mod.rs | 2 +- gix-transport/src/client/blocking_io/http/traits.rs | 2 +- gix-validate/tests/validate/reference.rs | 2 +- gix-worktree/tests/worktree/fs/cache/create_directory.rs | 2 +- 8 files changed, 13 insertions(+), 7 deletions(-) create mode 100644 _typos.toml diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000000..7f3e5091b15 --- /dev/null +++ b/_typos.toml @@ -0,0 +1,6 @@ +[files] +extend-exclude = ["**/CHANGELOG.md", "**/tests/fixtures/**"] + +[default.extend-words] +rela = "rela" +unter = "unter" diff --git a/gix-config/src/file/access/raw.rs b/gix-config/src/file/access/raw.rs index 46f1fb00649..44b318f24c0 100644 --- a/gix-config/src/file/access/raw.rs +++ b/gix-config/src/file/access/raw.rs @@ -136,7 +136,7 @@ impl<'event> File<'event> { /// ain order of occurrence. /// /// The ordering means that the last of the returned values is the one that would be the - /// value used in the single-value case.nd key. + /// value used in the single-value case.and key. /// /// # Examples /// diff --git a/gix-revision/tests/spec/parse/anchor/refnames.rs b/gix-revision/tests/spec/parse/anchor/refnames.rs index 9f3b7f25f99..0ddabc1f56e 100644 --- a/gix-revision/tests/spec/parse/anchor/refnames.rs +++ b/gix-revision/tests/spec/parse/anchor/refnames.rs @@ -3,7 +3,7 @@ use gix_revision::spec; use crate::spec::parse::{parse, try_parse}; #[test] -fn at_by_iteself_is_shortcut_for_head() { +fn at_by_itself_is_shortcut_for_head() { let rec = parse("@"); assert!(rec.kind.is_none()); assert_eq!(rec.get_ref(0), "HEAD"); diff --git a/gix-tempfile/tests/tempfile/fs/create_dir.rs b/gix-tempfile/tests/tempfile/fs/create_dir.rs index ac9dbea7b63..fa7c629d27f 100644 --- a/gix-tempfile/tests/tempfile/fs/create_dir.rs +++ b/gix-tempfile/tests/tempfile/fs/create_dir.rs @@ -47,7 +47,7 @@ mod iter { } #[test] - fn multiple_intermediate_directories_are_created_automaticaly() -> crate::Result { + fn multiple_intermediate_directories_are_created_automatically() -> crate::Result { let dir = tempfile::tempdir()?; let new_dir = dir.path().join("s1").join("s2").join("new"); let mut it = create_dir::Iter::new(&new_dir); diff --git a/gix-transport/src/client/blocking_io/http/mod.rs b/gix-transport/src/client/blocking_io/http/mod.rs index a1f4a86e315..5434a16be75 100644 --- a/gix-transport/src/client/blocking_io/http/mod.rs +++ b/gix-transport/src/client/blocking_io/http/mod.rs @@ -133,7 +133,7 @@ pub mod options { #[derive(Default, Clone)] pub struct Options { /// Headers to be added to every request. - /// They are applied unconditionally and are expected to be valid as they occour in an HTTP request, like `header: value`, without newlines. + /// They are applied unconditionally and are expected to be valid as they occur in an HTTP request, like `header: value`, without newlines. /// /// Refers to `http.extraHeader` multi-var. pub extra_headers: Vec, diff --git a/gix-transport/src/client/blocking_io/http/traits.rs b/gix-transport/src/client/blocking_io/http/traits.rs index 5b163f892a1..52176fecc87 100644 --- a/gix-transport/src/client/blocking_io/http/traits.rs +++ b/gix-transport/src/client/blocking_io/http/traits.rs @@ -84,7 +84,7 @@ impl From> for GetResponse { } /// A trait to abstract the HTTP operations needed to power all git interactions: read via GET and write via POST. -/// Note that 401 must be turned into `std::io::Error(PermissionDenied)`, and other non-success http stati must be transformed +/// Note that 401 must be turned into `std::io::Error(PermissionDenied)`, and other non-success http statuses must be transformed /// into `std::io::Error(Other)` #[allow(clippy::type_complexity)] pub trait Http { diff --git a/gix-validate/tests/validate/reference.rs b/gix-validate/tests/validate/reference.rs index e2ec8d1a217..f039a83129f 100644 --- a/gix-validate/tests/validate/reference.rs +++ b/gix-validate/tests/validate/reference.rs @@ -23,7 +23,7 @@ mod name_partial { mktest!(all_uppercase_with_underscore, b"NEW_HEAD"); mktest!(partial_name_lowercase, b"main"); mktest!(chinese_utf8, "heads/你好吗".as_bytes()); - mktest!(parantheses_special_case_upload_pack, b"(null)"); + mktest!(parentheses_special_case_upload_pack, b"(null)"); } mod invalid { diff --git a/gix-worktree/tests/worktree/fs/cache/create_directory.rs b/gix-worktree/tests/worktree/fs/cache/create_directory.rs index 23aa5c99b5b..a948d0e7803 100644 --- a/gix-worktree/tests/worktree/fs/cache/create_directory.rs +++ b/gix-worktree/tests/worktree/fs/cache/create_directory.rs @@ -4,7 +4,7 @@ use gix_worktree::fs; use tempfile::{tempdir, TempDir}; fn panic_on_find<'buf>(_oid: &gix_hash::oid, _buf: &'buf mut Vec) -> std::io::Result> { - unreachable!("find should nto be called") + unreachable!("find should not be called") } #[test]