|
1 |
| -from _typeshed import Incomplete |
| 1 | +import argparse |
| 2 | +from _typeshed import ExcInfo, FileDescriptorOrPath, Incomplete, OptExcInfo, SupportsWrite |
| 3 | +from collections.abc import Mapping, Sequence |
| 4 | +from typing import Any |
| 5 | +from typing_extensions import Self, deprecated |
2 | 6 |
|
| 7 | +@deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") |
3 | 8 | class _CannotLoadFile(Exception): ...
|
4 | 9 |
|
| 10 | +@deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") |
5 | 11 | class _Outputter:
|
6 |
| - def __init__(self, formatter, stdout, stderr): ... |
| 12 | + _formatter: _PlainFormatter | _PrettyFormatter |
| 13 | + _stdout: SupportsWrite[str] |
| 14 | + _stderr: SupportsWrite[str] |
| 15 | + |
| 16 | + def __init__( |
| 17 | + self, formatter: _PlainFormatter | _PrettyFormatter, stdout: SupportsWrite[str], stderr: SupportsWrite[str] |
| 18 | + ) -> None: ... |
7 | 19 | @classmethod
|
8 |
| - def from_arguments(cls, arguments, stdout, stderr): ... |
9 |
| - def load(self, path): ... |
10 |
| - def filenotfound_error(self, **kwargs) -> None: ... |
11 |
| - def parsing_error(self, **kwargs) -> None: ... |
12 |
| - def validation_error(self, **kwargs) -> None: ... |
13 |
| - def validation_success(self, **kwargs) -> None: ... |
| 20 | + def from_arguments( |
| 21 | + cls, arguments: Mapping[str, Incomplete], stdout: SupportsWrite[str], stderr: SupportsWrite[str] |
| 22 | + ) -> Self: ... |
| 23 | + def load(self, path: FileDescriptorOrPath) -> Any: ... # result of json.load() |
| 24 | + def filenotfound_error(self, *, path: FileDescriptorOrPath, exc_info: OptExcInfo) -> None: ... |
| 25 | + def parsing_error(self, *, path: FileDescriptorOrPath, exc_info: ExcInfo) -> None: ... |
| 26 | + def validation_error(self, *, instance_path: FileDescriptorOrPath, error: BaseException) -> None: ... |
| 27 | + def validation_success(self, *, instance_path: FileDescriptorOrPath) -> None: ... |
14 | 28 |
|
| 29 | +@deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") |
15 | 30 | class _PrettyFormatter:
|
16 |
| - def filenotfound_error(self, path, exc_info): ... |
17 |
| - def parsing_error(self, path, exc_info): ... |
18 |
| - def validation_error(self, instance_path, error): ... |
19 |
| - def validation_success(self, instance_path): ... |
| 31 | + _ERROR_MSG: str |
| 32 | + _SUCCESS_MSG: str |
| 33 | + |
| 34 | + def __init__(self) -> None: ... |
| 35 | + def filenotfound_error(self, path: FileDescriptorOrPath, exc_info: OptExcInfo) -> str: ... |
| 36 | + def parsing_error(self, path: FileDescriptorOrPath, exc_info: ExcInfo) -> str: ... |
| 37 | + def validation_error(self, instance_path: FileDescriptorOrPath, error: BaseException) -> str: ... |
| 38 | + def validation_success(self, instance_path: FileDescriptorOrPath) -> str: ... |
20 | 39 |
|
| 40 | +@deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") |
21 | 41 | class _PlainFormatter:
|
22 |
| - def __init__(self, error_format): ... |
23 |
| - def filenotfound_error(self, path, exc_info): ... |
24 |
| - def parsing_error(self, path, exc_info): ... |
25 |
| - def validation_error(self, instance_path, error): ... |
26 |
| - def validation_success(self, instance_path): ... |
| 42 | + _error_format: str |
| 43 | + |
| 44 | + def __init__(self, error_format: str) -> None: ... |
| 45 | + def filenotfound_error(self, path: FileDescriptorOrPath, exc_info: OptExcInfo) -> str: ... |
| 46 | + def parsing_error(self, path: FileDescriptorOrPath, exc_info: ExcInfo) -> str: ... |
| 47 | + def validation_error(self, instance_path: FileDescriptorOrPath, error: BaseException) -> str: ... |
| 48 | + def validation_success(self, instance_path: FileDescriptorOrPath) -> str: ... |
27 | 49 |
|
28 |
| -parser: Incomplete |
| 50 | +parser: argparse.ArgumentParser |
29 | 51 |
|
30 |
| -def parse_args(args): ... |
31 |
| -def main(args=...) -> None: ... |
32 |
| -def run(arguments, stdout=..., stderr=..., stdin=...): ... |
| 52 | +@deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") |
| 53 | +def parse_args(args: Sequence[str] | None) -> dict[str, Any]: ... # result of vars(argparse.Namespace()) |
| 54 | +@deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") |
| 55 | +def main(args: Sequence[str] = ...) -> None: ... |
| 56 | +@deprecated("The jsonschema CLI is deprecated and will be removed in a future version. Please use check-jsonschema instead.") |
| 57 | +def run( |
| 58 | + arguments: Mapping[str, Incomplete], |
| 59 | + stdout: SupportsWrite[str] = ..., |
| 60 | + stderr: SupportsWrite[str] = ..., |
| 61 | + stdin: SupportsWrite[str] = ..., |
| 62 | +) -> int: ... |
0 commit comments