Skip to content

Commit c0123b0

Browse files
Add pyright for type checking
- Best type checker to use in an IDE - Use both pyright and mypy - mypy run on pushes and in CI
1 parent 2b3f3fa commit c0123b0

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ repos:
7676
rev: "v1.18.2"
7777
hooks:
7878
- id: mypy
79-
stages: [pre-commit, pre-merge-commit, pre-push, manual]
79+
stages: [pre-push, manual]
8080
name: mypy
8181
additional_dependencies:
8282
# Need pydantic to load the pydantic.mypy plugin
@@ -86,3 +86,7 @@ repos:
8686
rev: 0.8.24
8787
hooks:
8888
- id: uv-lock
89+
- repo: https://github.com/RobertCraigie/pyright-python
90+
rev: v1.1.406
91+
hooks:
92+
- id: pyright

pyproject.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ dev = [
1919
"ruff>=0.6.9",
2020
"pytest>=8.3.3",
2121
"pytest-cov>=5.0.0",
22-
"mypy>=1.11.2",
22+
"mypy>=1.18.2",
2323
"pip-audit>=2.7.3",
24+
"pyright>=1.1.406",
2425
]
2526

2627
[tool.mypy]
@@ -40,6 +41,10 @@ plugins = [
4041
python_executable = ".venv/bin/python"
4142
fixed_format_cache = true
4243

44+
[tool.pyright]
45+
venvPath = "."
46+
venv = ".venv"
47+
4348
[tool.pytest.ini_options]
4449
minversion = "7.4"
4550
testpaths = ["tests"]

uv.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)