Repository: jorenham/optype (language: python)

Issue:
`codespell` -> `typos`
https://github.com/crate-ci/typos

ref: https://github.com/data-apis/array-api-typing/issues/1#issuecomment-2509165978


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 928e2915..4d9ddb45 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -29,7 +29,10 @@ jobs:
           config: ".markdownlint.yaml"
           globs: "**/*.md"
 
-      - name: Install uv
+      - name: typos
+        uses: crate-ci/typos@master
+
+      - name: install uv
         uses: astral-sh/setup-uv@v4
         with:
           enable-cache: true
@@ -37,8 +40,6 @@ jobs:
       - name: uv sync
         run: uv sync --frozen --python 3.10
 
-      - name: codespell
-        run: uv run codespell .
 
       - name: ruff check
         run: |
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 7c437eb0..70a54ad9 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,10 +2,6 @@ ci:
   autoupdate_branch: "master"
   autoupdate_commit_msg: "update pre-commit hooks"
   skip:
-    - markdownlint
-    - codespell
-    - ruff
-    - ruff-format
     - basedmypy
     - basedpyright
     - basedpyright-verifytypes
@@ -51,12 +47,10 @@ repos:
     hooks:
       - id: markdownlint
 
-  - repo: https://github.com/codespell-project/codespell
-    rev: v2.3.0
+  - repo: https://github.com/crate-ci/typos
+    rev: v1.28.1
     hooks:
-      - id: codespell
-        additional_dependencies:
-          - tomli
+      - id: typos
 
   - repo: https://github.com/astral-sh/ruff-pre-commit
     rev: v0.8.1
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 7f033052..e1bc2787 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -4,7 +4,8 @@
     "davidanson.vscode-markdownlint",
     "detachhead.basedpyright",
     "ms-python.mypy-type-checker",
-    "ms-python.python"
+    "ms-python.python",
+    "tekumara.typos-vscode"
   ],
   "unwantedRecommendations": ["ms-pyright.pyright", "ms-python.vscode-pylance"]
 }
diff --git a/optype/numpy/_any_dtype.py b/optype/numpy/_any_dtype.py
index b8113a93..29b1810d 100644
--- a/optype/numpy/_any_dtype.py
+++ b/optype/numpy/_any_dtype.py
@@ -7,7 +7,10 @@
 from __future__ import annotations
 
 import sys
-from typing import Literal as L, TypeAlias as Alias  # noqa: N817
+from typing import (
+    Literal as L,  # noqa: N817
+    TypeAlias as Alias,
+)
 
 import numpy as np
 
@@ -388,7 +391,7 @@ def dtype(self, /) -> np.dtype[_SCT_co]: ...
 
     _Code_uifc: Alias = L[_Code_ui, _Code_fc]
     # NOTE: this doesn't include `int` or `float` or `complex`, since that
-    # would autoamtically include `bool`.
+    # would automatically include `bool`.
     AnyNumberDType: Alias = _AnyDType[_sc.number] | _Code_uifc
 
     # NOTE: `np.dtypes.StringDType` didn't exist in the stubs prior to 2.1 (so
diff --git a/pyproject.toml b/pyproject.toml
index 00a07b1b..57f1980a 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -37,7 +37,6 @@ Funding = "https://github.com/sponsors/jorenham"
 
 [dependency-groups]
 lint = [
-    "codespell>=2.3.0",
     "ruff>=0.8.1",
     "sp-repo-review[cli]>=2024.8.19",
 ]
@@ -89,11 +88,6 @@ exclude = [
     "uv.lock",
 ]
 
-[tool.codespell]
-context = 2
-skip = "uv.lock,pyproject.toml"
-ignore-words-list = "AtMost,AtLeast,CanGe,ND,nin"
-
 [tool.mypy]
 python_version = "3.10"
 packages = ["optype", "examples", "tests"]
@@ -353,3 +347,7 @@ env_list = ["repo-review", "pre-commit", "3.10", "3.11", "3.12", "3.13"]
     allowlist_externals = ["uv"]
     commands_pre = [["uv", "sync", "--frozen"]]
     commands = [["uv", "run", "repo-review", "."]]
+
+
+[tool.typos.default]
+extend-ignore-identifiers-re = ["ND|nd", "(N|n)in"]
diff --git a/uv.lock b/uv.lock
index c3bb1091..01a0f3de 100644
--- a/uv.lock
+++ b/uv.lock
@@ -113,15 +113,6 @@ wheels = [
     { url = "https://files.pythonhosted.org/packages/00/2e/d53fa4befbf2cfa713304affc7ca780ce4fc1fd8710527771b58311a3229/click-8.1.7-py3-none-any.whl", hash = "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", size = 97941 },
 ]
 
-[[package]]
-name = "codespell"
-version = "2.3.0"
-source = { registry = "https://pypi.org/simple" }
-sdist = { url = "https://files.pythonhosted.org/packages/a0/a9/98353dfc7afcdf18cffd2dd3e959a25eaaf2728cf450caa59af89648a8e4/codespell-2.3.0.tar.gz", hash = "sha256:360c7d10f75e65f67bad720af7007e1060a5d395670ec11a7ed1fed9dd17471f", size = 329791 }
-wheels = [
-    { url = "https://files.pythonhosted.org/packages/0e/20/b6019add11e84f821184234cea0ad91442373489ef7ccfa3d73a71b908fa/codespell-2.3.0-py3-none-any.whl", hash = "sha256:a9c7cef2501c9cfede2110fd6d4e5e62296920efe9abfb84648df866e47f58d1", size = 329167 },
-]
-
 [[package]]
 name = "colorama"
 version = "0.4.6"
@@ -313,7 +304,6 @@ dev = [
     { name = "basedmypy", extra = ["faster-cache"] },
     { name = "basedpyright" },
     { name = "beartype" },
-    { name = "codespell" },
     { name = "numpy" },
     { name = "pre-commit" },
     { name = "pytest" },
@@ -323,7 +313,6 @@ dev = [
     { name = "typing-extensions" },
 ]
 lint = [
-    { name = "codespell" },
     { name = "ruff" },
     { name = "sp-repo-review", extra = ["cli"] },
 ]
@@ -363,7 +352,6 @@ dev = [
     { name = "basedmypy", extras = ["faster-cache"], specifier = ">=2.7.0" },
     { name = "basedpyright", specifier = ">=1.22.0" },
     { name = "beartype", specifier = ">=0.19.0" },
-    { name = "codespell", specifier = ">=2.3.0" },
     { name = "numpy", specifier = ">=1.24" },
     { name = "pre-commit", specifier = ">=4.0.1" },
     { name = "pytest", specifier = ">=8.3.3" },
@@ -373,7 +361,6 @@ dev = [
     { name = "typing-extensions", specifier = ">=4.10" },
 ]
 lint = [
-    { name = "codespell", specifier = ">=2.3.0" },
     { name = "ruff", specifier = ">=0.8.1" },
     { name = "sp-repo-review", extras = ["cli"], specifier = ">=2024.8.19" },
 ]


Test patch:
diff --git a/tests/numpy/test_to.pyi b/tests/numpy/test_to.pyi
index 8b14e60c..482ec524 100644
--- a/tests/numpy/test_to.pyi
+++ b/tests/numpy/test_to.pyi
@@ -77,7 +77,7 @@ mub: onp.ToBool2D = "illegal"  # type: ignore[assignment]  # pyright: ignore[rep
 muj: onp.ToJustInt2D = "illegal"  # type: ignore[assignment]  # pyright: ignore[reportAssignmentType]
 mui: onp.ToInt2D = "illegal"  # type: ignore[assignment]  # pyright: ignore[reportAssignmentType]
 muf: onp.ToFloat2D = "illegal"  # type: ignore[assignment]  # pyright: ignore[reportAssignmentType]
-muc: onp.ToComplex2D = "illegal"  # type: ignore[assignment]  # pyright: ignore[reportAssignmentType]
+muz: onp.ToComplex2D = "illegal"  # type: ignore[assignment]  # pyright: ignore[reportAssignmentType]
 
 # tensors
 tb: onp.ToBoolND = arr_b