pyright 1.1.409 fails as a pre-commit hook
Open
Nobody has claimed this yet.
bug
- Dominant language
- Python
- Stars
- 15.6k
- Forks
- 1.8k
- Avg merge
- 12h 13m
- Merged PRs (30d)
- 52
Description
Describe the bug
pyright 1.1.409 fails in pre-commit while it works just fine in stand-alone mode. pyright 1.1.408 works fine everywhere.
Code or Screenshots
mkdir Bug
cd Bug
git init
uv venv
.venv\Scripts\activate
uv pip install pyright==1.1.409 pre-commit
echo repos: [{repo: https://github.com/RobertCraigie/pyright-python, rev: v1.1.409, hooks: [{id: pyright}]}] > .pre-commit-config.yaml
pre-commit install
echo p: int ^| None > bug.py
git add bug.py
pyright bug.py
pre-commit run pyright --all-files
Output:
(Bug) C:\Git\Bug>pyright bug.py
0 errors, 0 warnings, 0 informations
(Bug) C:\Git\Bug>pre-commit run pyright --all-files
pyright..................................................................Failed
- hook id: pyright
- exit code: 1
c:\Git\Bug\bug.py
c:\Git\Bug\bug.py:1:4 - error: Operator "|" not supported for types "type[int]" and "type[Unknown]" (reportOperatorIssue)
1 error, 0 warnings, 0 informations
VS Code extension or command-line
pyright 1.1.409 via pyright-python
This is a regression from 1.1.408.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the standalone and pre-commit commands from the issue using pyright 1.1.409, then compare them with 1.1.408 and inspect the generated .pre-commit-config.yaml hook invocation. Done means the minimal bug.py example produces the same successful result through pre-commit as it does when run directly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100