File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 49
49
- id : codespell
50
50
args : ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"]
51
51
- repo : https://github.com/pre-commit/mirrors-mypy
52
- rev : v1.15 .0
52
+ rev : v1.16 .0
53
53
hooks :
54
54
- id : mypy
55
55
# Sync with project.optional-dependencies.typing
Original file line number Diff line number Diff line change @@ -95,6 +95,11 @@ source = [
95
95
[tool .coverage .run ]
96
96
parallel = true
97
97
98
+ [tool .coverage .report ]
99
+ exclude_also = [
100
+ " if.*TYPE_CHECKING:" ,
101
+ ]
102
+
98
103
# Release process:
99
104
# cd tools/schemacode
100
105
# uvx bump-my-version bump pre_label --tag
Original file line number Diff line number Diff line change 10
10
11
11
TYPE_CHECKING = False
12
12
if TYPE_CHECKING :
13
- from typing import Any
13
+ from typing import Any , NotRequired , TypedDict
14
14
15
+ from jsonschema import FormatChecker
15
16
from jsonschema .protocols import Validator as JsonschemaValidator
16
17
18
+ class ValidatorKwargs (TypedDict ):
19
+ """Type for the keyword arguments used to create a JSON schema validator."""
20
+
21
+ format_checker : NotRequired [FormatChecker ]
22
+
17
23
18
24
def get_bundled_schema_path ():
19
25
"""Get the path to the schema directory.
@@ -140,5 +146,6 @@ def jsonschema_validator(
140
146
# Ensure the schema is valid
141
147
validator_cls .check_schema (schema )
142
148
149
+ validator_kwargs : ValidatorKwargs
143
150
validator_kwargs = {"format_checker" : validator_cls .FORMAT_CHECKER } if check_format else {}
144
151
return validator_cls (schema , ** validator_kwargs )
You can’t perform that action at this time.
0 commit comments