diff --git a/.codespellrc b/.codespellrc deleted file mode 100644 index 929bd589b7112..0000000000000 --- a/.codespellrc +++ /dev/null @@ -1,3 +0,0 @@ -[codespell] -skip = .git,target,testdata,Cargo.toml,Cargo.lock -ignore-words-list = crate,ser,ratatui,Caf,froms,strat diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8709cd7b07776..6b2b2324ba04e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -53,14 +53,12 @@ jobs: cache-on-failure: true - run: cargo test --workspace --doc - codespell: + typos: runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v4 - - uses: codespell-project/actions-codespell@v2 - with: - skip: "*.json" + - uses: crate-ci/typos@v1 clippy: runs-on: ubuntu-latest @@ -120,7 +118,7 @@ jobs: - nextest - docs - doctest - - codespell + - typos - clippy - rustfmt - forge-fmt diff --git a/Makefile b/Makefile index 0fa6df9bd581d..e6c31e71752fe 100644 --- a/Makefile +++ b/Makefile @@ -105,19 +105,19 @@ lint-clippy: ## Run clippy on the codebase. --all-features \ -- -D warnings -.PHONY: lint-codespell -lint-codespell: ## Run codespell on the codebase. - @command -v codespell >/dev/null || { \ - echo "codespell not found. Please install it by running the command `pipx install codespell` or refer to the following link for more information: https://github.com/codespell-project/codespell" \ +.PHONY: lint-typos +lint-typos: ## Run typos on the codebase. + @command -v typos >/dev/null || { \ + echo "typos not found. Please install it by running the command `cargo install typos-cli` or refer to the following link for more information: https://github.com/crate-ci/typos" \ exit 1; \ } - codespell --skip "*.json" + typos .PHONY: lint lint: ## Run all linters. make fmt && \ make lint-clippy && \ - make lint-codespell + make lint-typos ##@ Other diff --git a/crates/cli/src/utils/mod.rs b/crates/cli/src/utils/mod.rs index 30dddca74a67e..4d9cb27872e22 100644 --- a/crates/cli/src/utils/mod.rs +++ b/crates/cli/src/utils/mod.rs @@ -671,7 +671,7 @@ ignore them in the `.gitignore` file." /// If the status is prefix with `-`, the submodule is not initialized. /// /// Ref: - pub fn submodules_unintialized(self) -> Result { + pub fn submodules_uninitialized(self) -> Result { self.cmd() .args(["submodule", "status"]) .get_stdout_lossy() diff --git a/crates/forge/src/cmd/install.rs b/crates/forge/src/cmd/install.rs index b2edec63a2465..4501a4aff8607 100644 --- a/crates/forge/src/cmd/install.rs +++ b/crates/forge/src/cmd/install.rs @@ -123,7 +123,7 @@ impl DependencyInstallOpts { // Check if submodules are uninitialized, if so, we need to fetch all submodules // This is to ensure that foundry.lock syncs successfully and doesn't error out, when // looking for commits/tags in submodules - if git.submodules_unintialized()? { + if git.submodules_uninitialized()? { trace!(lib = %libs.display(), "submodules uninitialized"); git.submodule_update(false, false, false, true, Some(&libs))?; } diff --git a/crates/forge/src/cmd/update.rs b/crates/forge/src/cmd/update.rs index 9352f359e2fc4..dfb821aedc9d6 100644 --- a/crates/forge/src/cmd/update.rs +++ b/crates/forge/src/cmd/update.rs @@ -52,7 +52,7 @@ impl UpdateArgs { foundry_lock.iter_mut().for_each(|(_path, dep_id)| { // Set r#override flag to true if the dep is a branch if let DepIdentifier::Branch { .. } = dep_id { - dep_id.mark_overide(); + dep_id.mark_override(); } }); } else { diff --git a/crates/forge/src/lockfile.rs b/crates/forge/src/lockfile.rs index 716f9ae3df2e1..9c7339ffbfb43 100644 --- a/crates/forge/src/lockfile.rs +++ b/crates/forge/src/lockfile.rs @@ -178,7 +178,7 @@ impl<'a> Lockfile<'a> { .deps .get_mut(dep) .map(|d| { - new_dep_id.mark_overide(); + new_dep_id.mark_override(); std::mem::replace(d, new_dep_id) }) .ok_or_eyre(format!("Dependency not found in lockfile: {}", dep.display()))?; @@ -232,7 +232,7 @@ pub enum DepIdentifier { /// Release tag `name` and the `rev` it is currently pointing to. /// Running `forge update` does not update the tag/rev. /// Dependency will remain pinned to the existing tag/rev unless r#override like so `forge - /// update owner/dep@tag=diffent_tag`. + /// update owner/dep@tag=different_tag`. #[serde(rename = "tag")] Tag { name: String, @@ -304,7 +304,7 @@ impl DepIdentifier { } /// Marks as dependency as overridden. - pub fn mark_overide(&mut self) { + pub fn mark_override(&mut self) { match self { Self::Branch { r#override, .. } => *r#override = true, Self::Tag { r#override, .. } => *r#override = true, diff --git a/crates/forge/tests/cli/install.rs b/crates/forge/tests/cli/install.rs index 2a361d9d45ee6..c842224cb41af 100644 --- a/crates/forge/tests/cli/install.rs +++ b/crates/forge/tests/cli/install.rs @@ -414,7 +414,7 @@ Installing forge-5980-test in [..] (url: Some("https://github.com/evalir/forge-5 let config = Config { remappings: vec![ Remapping::from_str("forge-5980-test/=lib/forge-5980-test/src/").unwrap().into(), - // explicit remapping for sub-dependendy seems necessary for some reason + // explicit remapping for sub-dependency seems necessary for some reason Remapping::from_str( "forge-5980-test-dep/=lib/forge-5980-test/lib/forge-5980-test-dep/src/", ) diff --git a/crates/lint/src/linter/mod.rs b/crates/lint/src/linter/mod.rs index f6770038eecf3..dcd86d16e2c6a 100644 --- a/crates/lint/src/linter/mod.rs +++ b/crates/lint/src/linter/mod.rs @@ -26,7 +26,7 @@ use crate::inline_config::InlineConfig; /// /// # Required Methods /// -/// - `init`: Creates a new solar `Session` with the appropiate linter configuration. +/// - `init`: Creates a new solar `Session` with the appropriate linter configuration. /// - `early_lint`: Scans the source files (using the AST) emitting a diagnostic for lints found. /// - `late_lint`: Scans the source files (using the HIR) emitting a diagnostic for lints found. pub trait Linter: Send + Sync + Clone { diff --git a/typos.toml b/typos.toml new file mode 100644 index 0000000000000..524e7e92f7784 --- /dev/null +++ b/typos.toml @@ -0,0 +1,22 @@ +[files] +extend-exclude = [ + ".git", + "target", + "testdata", + "Cargo.toml", + "Cargo.lock", + "*.json", + "**/tests/**", + "**/test/**", + "**/*_test.*", + "**/*_tests.*", +] + +[default.extend-words] +crate = "crate" +ser = "ser" +ratatui = "ratatui" +Caf = "Caf" +froms = "froms" +strat = "strat" +ba = "ba"