diff --git a/arkindex/documents/management/commands/move_lines_to_parent.py b/arkindex/documents/management/commands/move_lines_to_parent.py index 2927bc6b39163e30fd9e5210c822b976ab7c4a40..42229e194b96967cd25e59d956cc80c7ec1ccfe9 100644 --- a/arkindex/documents/management/commands/move_lines_to_parent.py +++ b/arkindex/documents/management/commands/move_lines_to_parent.py @@ -7,9 +7,11 @@ from arkindex.documents.models import ElementType from arkindex.project.argparse import CorpusArgument # x and y of top left and bottom right points -BBox = NamedTuple( - "BBox", [("left", int), ("top", int), ("right", int), ("bottom", int)] -) +class BBox(NamedTuple): + left: int + top: int + right: int + bottom: int def compute_polygon_area(polygon: BBox): diff --git a/ruff.toml b/ruff.toml index bbd5b4c3417902d9ce1967aca0af2577b31aab71..66759351ff95c325e26952a99aad73c38dc3391c 100644 --- a/ruff.toml +++ b/ruff.toml @@ -29,6 +29,8 @@ select = [ "UP004", # unnecessary-encode-utf8 "UP012", + # convert-named-tuple-functional-to-class + "UP014", ] ignore = ["E501", "RET502", "RET503"]