Skip to content

Commit d3484d9

Browse files
build(pyproject): add pyright
1 parent b67481d commit d3484d9

3 files changed

Lines changed: 21 additions & 3 deletions

File tree

.github/CONTRIBUTING.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,18 +98,24 @@ Run all pre-commit hooks:
9898
uv run pre-commit run --all-files
9999
```
100100

101-
Lint all files in the current directory:
101+
Lint all files:
102102

103103
```sh
104-
uv run ruff check --fix
104+
uv run ruff check # --fix
105105
```
106106

107-
Format all files in the current directory:
107+
Format all files:
108108

109109
```sh
110110
uv run ruff format
111111
```
112112

113+
Run type checking:
114+
115+
```sh
116+
uv run pyright
117+
```
118+
113119
## Build
114120

115121
Generate distribution packages:

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,9 @@ repos:
2121
- id: ruff
2222
args: [--fix]
2323
- id: ruff-format
24+
25+
- repo: https://github.com/RobertCraigie/pyright-python
26+
rev: v1.1.408
27+
hooks:
28+
- id: pyright
29+
entry: bash -c 'uv run pyright'

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ docs = [
2222
lint = [
2323
"mypy==1.19.1",
2424
"pre-commit==4.5.1",
25+
"pyright==1.1.408",
2526
"ruff==0.15.2",
2627
]
2728
test = [
@@ -74,3 +75,8 @@ fail_under = 100
7475

7576
[tool.coverage.html]
7677
show_contexts = true
78+
79+
[tool.pyright]
80+
include = ["src", "tests"]
81+
strict = ["src/**"]
82+
typeCheckingMode = "strict"

0 commit comments

Comments
 (0)