From 4cb020ecef0c66688bf90e3dcccc4935069f0500 Mon Sep 17 00:00:00 2001 From: Tobias Klockau Date: Mon, 28 Oct 2024 18:56:51 +0100 Subject: [PATCH] lint: enable TID252 --- .pre-commit-config.yaml | 4 ++-- pyproject.toml | 3 --- raillabel_providerkit/_util/_attribute_type.py | 2 +- raillabel_providerkit/convert/convert.py | 3 ++- .../convert/loader_classes/loader_understand_ai.py | 5 +++-- raillabel_providerkit/format/understand_ai/_annotation.py | 3 ++- raillabel_providerkit/format/understand_ai/frame.py | 3 ++- raillabel_providerkit/format/understand_ai/scene.py | 3 ++- .../validation/validate_onthology/validate_onthology.py | 3 ++- 9 files changed, 16 insertions(+), 13 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3f69573..281033c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,11 +29,11 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.7.0 hooks: + - id: ruff-format + name: Run Formatter - id: ruff name: Run Linter args: [ --fix ] - - id: ruff-format - name: Run Formatter - repo: https://github.com/Lucas-C/pre-commit-hooks rev: v1.5.5 diff --git a/pyproject.toml b/pyproject.toml index 9dc8a3d..c572fde 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,9 +81,6 @@ ignore = [ "TCH003", # same as TCH001 "SIM103", # less readable in some cases imo - - # to be removed later - "TID252", ] [tool.mypy] diff --git a/raillabel_providerkit/_util/_attribute_type.py b/raillabel_providerkit/_util/_attribute_type.py index 29909f3..fbe8aaa 100644 --- a/raillabel_providerkit/_util/_attribute_type.py +++ b/raillabel_providerkit/_util/_attribute_type.py @@ -5,7 +5,7 @@ from enum import Enum -from ..exceptions import ValueDoesNotMatchTypeError +from raillabel_providerkit.exceptions import ValueDoesNotMatchTypeError class AttributeType(Enum): diff --git a/raillabel_providerkit/convert/convert.py b/raillabel_providerkit/convert/convert.py index 5b59096..753e5c9 100644 --- a/raillabel_providerkit/convert/convert.py +++ b/raillabel_providerkit/convert/convert.py @@ -5,7 +5,8 @@ import raillabel -from ..exceptions import UnsupportedFormatError +from raillabel_providerkit.exceptions import UnsupportedFormatError + from . import loader_classes as loader_classes_pkg from .loader_classes import LoaderABC diff --git a/raillabel_providerkit/convert/loader_classes/loader_understand_ai.py b/raillabel_providerkit/convert/loader_classes/loader_understand_ai.py index ba1c1fa..84a5af6 100644 --- a/raillabel_providerkit/convert/loader_classes/loader_understand_ai.py +++ b/raillabel_providerkit/convert/loader_classes/loader_understand_ai.py @@ -9,8 +9,9 @@ import jsonschema import raillabel -from ..._util._warning import _WarningsLogger -from ...format import understand_ai as uai_format +from raillabel_providerkit._util._warning import _WarningsLogger +from raillabel_providerkit.format import understand_ai as uai_format + from ._loader_abc import LoaderABC diff --git a/raillabel_providerkit/format/understand_ai/_annotation.py b/raillabel_providerkit/format/understand_ai/_annotation.py index d8d2749..b8f2bbd 100644 --- a/raillabel_providerkit/format/understand_ai/_annotation.py +++ b/raillabel_providerkit/format/understand_ai/_annotation.py @@ -7,7 +7,8 @@ from dataclasses import dataclass from uuid import UUID -from ..._util._attribute_type import AttributeType +from raillabel_providerkit._util._attribute_type import AttributeType + from ._translation import translate_class_id, translate_sensor_id from .sensor_reference import SensorReference diff --git a/raillabel_providerkit/format/understand_ai/frame.py b/raillabel_providerkit/format/understand_ai/frame.py index cb3a77a..d82959b 100644 --- a/raillabel_providerkit/format/understand_ai/frame.py +++ b/raillabel_providerkit/format/understand_ai/frame.py @@ -7,7 +7,8 @@ from dataclasses import dataclass from decimal import Decimal -from ..._util._warning import _warning +from raillabel_providerkit._util._warning import _warning + from ._annotation import _Annotation from ._translation import translate_class_id, translate_sensor_id from .bounding_box_2d import BoundingBox2d diff --git a/raillabel_providerkit/format/understand_ai/scene.py b/raillabel_providerkit/format/understand_ai/scene.py index 035ef72..9d72472 100644 --- a/raillabel_providerkit/format/understand_ai/scene.py +++ b/raillabel_providerkit/format/understand_ai/scene.py @@ -5,7 +5,8 @@ from dataclasses import dataclass -from ..._util._warning import _warning +from raillabel_providerkit._util._warning import _warning + from .coordinate_system import CoordinateSystem from .frame import Frame from .metadata import Metadata diff --git a/raillabel_providerkit/validation/validate_onthology/validate_onthology.py b/raillabel_providerkit/validation/validate_onthology/validate_onthology.py index 4ddbee2..aab48ba 100644 --- a/raillabel_providerkit/validation/validate_onthology/validate_onthology.py +++ b/raillabel_providerkit/validation/validate_onthology/validate_onthology.py @@ -9,7 +9,8 @@ import raillabel import yaml -from ...exceptions import OnthologySchemaError +from raillabel_providerkit.exceptions import OnthologySchemaError + from ._onthology_classes._onthology import _Onthology