Skip to content

Commit 7eb1ca1

Browse files
[pre-commit] Add a manual stage for pyright (#10416)
1 parent 8d184b5 commit 7eb1ca1

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,16 @@ repos:
8484
# require_serial: true
8585
args: ["-rn", "-sn", "--rcfile=pylintrc", "--fail-on=I"]
8686
exclude: tests(/\w*)*/functional/|tests/input|tests(/\w*)*data/|doc/
87+
- id: pyright
88+
name: pyright
89+
description: "Python command line wrapper for pyright, a static type checker"
90+
entry: pyright
91+
language: python
92+
"types_or": [python, pyi]
93+
require_serial: true
94+
minimum_pre_commit_version: "2.9.2"
95+
exclude: tests(/\w*)*/functional/|tests/input|tests(/.*)+/conftest.py|doc/data/messages|tests(/\w*)*data/
96+
stages: [manual]
8797
# We define an additional manual step to allow running pylint with a spelling
8898
# checker in CI.
8999
- id: pylint

pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,5 +224,14 @@ module = [
224224
"sphinx.*",
225225
]
226226

227+
[tool.pyright]
228+
include = [
229+
"pylint",
230+
]
231+
pythonVersion = "3.9"
232+
typeCheckingMode = "basic"
233+
reportMissingImports = "none"
234+
reportMissingModuleSource = "none"
235+
227236
[tool.aliases]
228237
test = "pytest"

requirements_test_pre_commit.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ ruff
88
flake8-typing-imports
99
isort
1010
mypy
11+
pyright

0 commit comments

Comments
 (0)