diff --git a/src/officialeye/_internal/diffobject/difference_expansion.py b/src/officialeye/_internal/diffobject/difference_expansion.py index c96a24d..da556f0 100644 --- a/src/officialeye/_internal/diffobject/difference_expansion.py +++ b/src/officialeye/_internal/diffobject/difference_expansion.py @@ -52,9 +52,9 @@ def _do_add(specification_dict: Dict[str, any], continue specification_entry = specification_dict[key] - current_value = current_dict[key] if key in current_dict else None # corresponding value in `self._cur_object` + current_value = current_dict.get(key) # corresponding value in `self._cur_object` object_value = object_dict[key] # corresponding value in `partial_object` - object_value_diff_mode = object_dict[f"${key}"] if f"${key}" in object_dict else None + object_value_diff_mode = object_dict.get(f"${key}", None) full_key = f"{previous_keys}{key}" diff --git a/src/officialeye/_internal/template/utils.py b/src/officialeye/_internal/template/utils.py index 1626bce..6aacc59 100644 --- a/src/officialeye/_internal/template/utils.py +++ b/src/officialeye/_internal/template/utils.py @@ -11,6 +11,6 @@ def load_mutator_from_dict(mutator_dict: Dict[str, any], /) -> IMutator: mutator_id = mutator_dict["id"] - mutator_config = mutator_dict["config"] if "config" in mutator_dict else {} + mutator_config = mutator_dict.get("config", {}) return get_internal_context().get_mutator(mutator_id, mutator_config) diff --git a/src/officialeye/detection.py b/src/officialeye/detection.py index 2158236..d6e4fce 100644 --- a/src/officialeye/detection.py +++ b/src/officialeye/detection.py @@ -2,4 +2,8 @@ Module providing an API for all OfficialEye's document detection tools. """ +# disable unused imports ruff check +# ruff: noqa: F401 + # noinspection PyProtectedMember +from officialeye._api.detection import detect