pyright
TLDR
Type check project
$ pyright
Type check specific files$ pyright [file.py]
Watch for changes$ pyright --watch
Output in JSON$ pyright --outputjson
Show version$ pyright --version
Create config file$ pyright --createstub [package]
SYNOPSIS
pyright [options] [files...]
DESCRIPTION
pyright is a static type checker for Python. It analyzes Python code for type errors without running it, providing fast feedback in editors and CI pipelines.
The tool implements the Python type system from PEP 484 and subsequent typing PEPs, offering strict checking and IDE integration.
PARAMETERS
--watch
Watch mode for changes.--outputjson
JSON output format.--project dir
Project root directory.--pythonplatform platform
Target platform.--pythonversion version
Target Python version.--level level
Diagnostic level (basic, standard, strict).--stats
Show performance statistics.--verifytypes package
Verify package types.--createstub package
Generate stub files.
CAVEATS
Requires type annotations for full benefit. Some dynamic patterns hard to type. Configuration needed for complex projects. Not all libraries have type stubs.
HISTORY
Pyright was developed by Microsoft and released in 2019. It powers Python language support in VS Code through Pylance. Written in TypeScript, it focuses on performance and standards compliance.


