ty¶
Ty ¶
Bases: Tool[_R]
Classes:
| Name | Description |
|---|---|
Check |
|
Methods:
| Name | Description |
|---|---|
__call__ |
An extremely fast Python type checker. |
flags |
Bind tool-level global options before the subcommand. |
Attributes:
| Name | Type | Description |
|---|---|---|
check |
Check[_R]
|
|
argv |
Ty[Argv]
|
|
Check ¶
Bases: Tool[_R2]
Methods:
| Name | Description |
|---|---|
__call__ |
Check a project for type errors |
Attributes:
| Name | Type | Description |
|---|---|---|
argv |
Check[Argv]
|
|
__call__ ¶
__call__(*args: str | PathLike[str], add_ignore: Flag = ..., color: Color | Sequence[Color] | None = ..., config: Value = ..., config_file: Value = ..., error: Value = ..., error_on_warning: Flag = ..., exclude: Value = ..., exclude_scripts: Flag = ..., exit_zero: Flag = ..., exit_zero_on_warning: Flag = ..., extra_search_path: Value = ..., fix: Flag = ..., force_exclude: Flag = ..., ignore: Value = ..., no_progress: Flag = ..., output_format: OutputFormat | Sequence[OutputFormat] | None = ..., project: Value = ..., python: Value = ..., python_platform: Value = ..., python_version: PythonVersion | Sequence[PythonVersion] | None = ..., quiet: Flag = ..., respect_ignore_files: Flag = ..., typeshed: Value = ..., verbose: Flag = ..., warn: Value = ..., watch: Flag = ..., **flags: Any) -> _R2
Check a project for type errors
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
add_ignore
|
Flag
|
Adds |
...
|
color
|
Color | Sequence[Color] | None
|
Control when colored output is used. |
...
|
config
|
Value
|
A TOML |
...
|
config_file
|
Value
|
The path to a |
...
|
error
|
Value
|
Treat the given rule as having severity 'error'. May be repeated: a list emits the flag once per item. |
...
|
error_on_warning
|
Flag
|
Use exit code 1 if there are any warning-level diagnostics. |
...
|
exclude
|
Value
|
Glob patterns for files to exclude from type checking. |
...
|
exclude_scripts
|
Flag
|
Exclude files containing PEP 723 inline script metadata unless passed explicitly. |
...
|
exit_zero
|
Flag
|
Always use exit code 0, even when there are error-level diagnostics. |
...
|
exit_zero_on_warning
|
Flag
|
Use exit code 0 if there are no error-level diagnostics. |
...
|
extra_search_path
|
Value
|
Additional path to use as a module-resolution source (can be passed multiple times). May be repeated: a list emits the flag once per item. |
...
|
fix
|
Flag
|
Apply fixes to resolve errors. |
...
|
force_exclude
|
Flag
|
Enforce exclusions, even for paths passed to ty directly on the command-line. |
...
|
ignore
|
Value
|
Disables the rule. May be repeated: a list emits the flag once per item. |
...
|
no_progress
|
Flag
|
Hide all progress outputs. |
...
|
output_format
|
OutputFormat | Sequence[OutputFormat] | None
|
The format to use for printing diagnostic messages. |
...
|
project
|
Value
|
Run the command within the given project directory. |
...
|
python
|
Value
|
Path to your project's Python environment or interpreter. |
...
|
python_platform
|
Value
|
Target platform to assume when resolving types. |
...
|
python_version
|
PythonVersion | Sequence[PythonVersion] | None
|
Python version to assume when resolving types. |
...
|
quiet
|
Flag
|
Use quiet output (or |
...
|
respect_ignore_files
|
Flag
|
Respect file exclusions via |
...
|
typeshed
|
Value
|
Custom directory to use for stdlib typeshed stubs. |
...
|
verbose
|
Flag
|
Use verbose output (or |
...
|
warn
|
Value
|
Treat the given rule as having severity 'warn'. May be repeated: a list emits the flag once per item. |
...
|
watch
|
Flag
|
Watch files for changes and recheck files related to the changed files. |
...
|
__call__ ¶
An extremely fast Python type checker.