mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 18:15:28 +03:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user