ref: typehints, enum instead of raw string, abc and other (#1)

Full code coverage with annotations, fixing errors in various linters: ruff, wps, etc. Fixing errors in type checkers: ty, mypy, pyright. Formatting and bringing code to a consistent style, applying best practices in various aspects.
This commit is contained in:
kolo
2025-10-08 13:37:31 +03:00
committed by GitHub
parent 22f1171192
commit 73303b1c08
45 changed files with 983 additions and 996 deletions
+5 -5
View File
@@ -8,7 +8,7 @@ class BaseDividingLine(ABC):
:param unit_part: the single part of the dividing line
:return: None
"""
self._unit_part = unit_part
self._unit_part: str = unit_part
def get_unit_part(self) -> str:
"""
@@ -22,7 +22,7 @@ class BaseDividingLine(ABC):
class StaticDividingLine(BaseDividingLine):
def __init__(self, unit_part: str = "-", length: int = 25) -> None:
def __init__(self, unit_part: str = "-", *, length: int = 25) -> None:
"""
Public. The static dividing line
:param unit_part: the single part of the dividing line
@@ -30,9 +30,9 @@ class StaticDividingLine(BaseDividingLine):
:return: None
"""
super().__init__(unit_part)
self.length = length
self.length: int = length
def get_full_static_line(self, is_override: bool) -> str:
def get_full_static_line(self, *, is_override: bool) -> str:
"""
Private. Returns the full line of the dividing line
:param is_override: has the default text layout been redefined
@@ -53,7 +53,7 @@ class DynamicDividingLine(BaseDividingLine):
"""
super().__init__(unit_part)
def get_full_dynamic_line(self, length: int, is_override: bool) -> str:
def get_full_dynamic_line(self, *, length: int, is_override: bool) -> str:
"""
Private. Returns the full line of the dividing line
:param length: the length of the dividing line