Skip to content

Commit 0c87259

Browse files
🔧 add sphinx to pre-commit
1 parent a3090e7 commit 0c87259

2 files changed

Lines changed: 20 additions & 5 deletions

File tree

.pre-commit-config.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,18 @@ repos:
4141
- types-setuptools
4242
- importlib-metadata
4343
- types-Pillow
44+
- repo: local
45+
hooks:
46+
- id: sphinx-html
47+
name: Sphinx HTML build
48+
entry: make -C docs html
49+
language: system
50+
pass_filenames: false
51+
files: ^docs/.*$|^mindee/.*\.py$
52+
53+
- id: sphinx-linkcheck
54+
name: Sphinx Linkcheck
55+
entry: make -C docs linkcheck
56+
language: system
57+
pass_filenames: false
58+
files: ^docs/.*$|^mindee/.*\.py$

mindee/v2/parsing/inference/field/object_field.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections.abc import Callable
22
from typing import TYPE_CHECKING, cast
33

4-
from mindee.parsing.common import StringDict
4+
from mindee.parsing.common.string_dict import StringDict
55
from mindee.v2.parsing.inference.field.base_field import BaseField, FieldType
66
from mindee.v2.parsing.inference.field.inference_fields import InferenceFields
77

@@ -51,7 +51,7 @@ def simple_fields(self) -> dict[str, "SimpleField"]:
5151
Extract and return all SimpleField fields from the `fields` attribute.
5252
5353
:return: A dictionary containing all fields that have a type of
54-
`FieldType.SIMPLE`.
54+
`FieldType.SIMPLE`.
5555
"""
5656
simple_fields = {}
5757
for field_key, field_value in self.fields.items():
@@ -80,8 +80,8 @@ def object_fields(self) -> dict[str, "ObjectField"]:
8080
Retrieves all ObjectField fields from the `fields` attribute of the instance.
8181
8282
:returns: A dictionary containing fields of type `FieldType.OBJECT`. The keys
83-
represent
84-
the field names, and the values are corresponding ObjectField objects.
83+
represent the field names, and the values are corresponding ObjectField
84+
objects.
8585
"""
8686
object_fields = {}
8787
for field_key, field_value in self.fields.items():
@@ -123,7 +123,7 @@ def get_object_field(self, field_name: str) -> "ObjectField":
123123
:type field_name: str
124124
:return: The `ObjectField` associated with the given field name.
125125
:raises ValueError: If the field specified by `field_name` is not an
126-
`ObjectField`.
126+
`ObjectField`.
127127
"""
128128
if self.fields[field_name].field_type != FieldType.OBJECT:
129129
raise ValueError(f"Field {field_name} is not an ObjectField.")

0 commit comments

Comments
 (0)