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 4949 - id : codespell
5050 args : ["--config=.codespellrc", "--dictionary=-", "--dictionary=.codespell_dict"]
5151 - repo : https://github.com/pre-commit/mirrors-mypy
52- rev : v1.15 .0
52+ rev : v1.16 .0
5353 hooks :
5454 - id : mypy
5555 # Sync with project.optional-dependencies.typing
Original file line number Diff line number Diff line change @@ -95,6 +95,11 @@ source = [
9595[tool .coverage .run ]
9696parallel = true
9797
98+ [tool .coverage .report ]
99+ exclude_also = [
100+ " if.*TYPE_CHECKING:" ,
101+ ]
102+
98103# Release process:
99104# cd tools/schemacode
100105# uvx bump-my-version bump pre_label --tag
Original file line number Diff line number Diff line change 1010
1111TYPE_CHECKING = False
1212if TYPE_CHECKING :
13- from typing import Any
13+ from typing import Any , NotRequired , TypedDict
1414
15+ from jsonschema import FormatChecker
1516 from jsonschema .protocols import Validator as JsonschemaValidator
1617
18+ class ValidatorKwargs (TypedDict ):
19+ """Type for the keyword arguments used to create a JSON schema validator."""
20+
21+ format_checker : NotRequired [FormatChecker ]
22+
1723
1824def get_bundled_schema_path ():
1925 """Get the path to the schema directory.
@@ -140,5 +146,6 @@ def jsonschema_validator(
140146 # Ensure the schema is valid
141147 validator_cls .check_schema (schema )
142148
149+ validator_kwargs : ValidatorKwargs
143150 validator_kwargs = {"format_checker" : validator_cls .FORMAT_CHECKER } if check_format else {}
144151 return validator_cls (schema , ** validator_kwargs )
You can’t perform that action at this time.
0 commit comments