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
+11 -8
View File
@@ -1,9 +1,12 @@
from typing import override
class RepeatedFlagNameException(Exception):
"""
Private. Raised when a repeated flag name is registered
"""
def __str__(self):
@override
def __str__(self) -> str:
return "Repeated registered flag names in register command"
@@ -11,8 +14,8 @@ class TooManyTransferredArgsException(Exception):
"""
Private. Raised when too many arguments are passed
"""
def __str__(self):
@override
def __str__(self) -> str:
return "Too many transferred arguments"
@@ -20,8 +23,8 @@ class RequiredArgumentNotPassedException(Exception):
"""
Private. Raised when a required argument is not passed
"""
def __str__(self):
@override
def __str__(self) -> str:
return "Required argument not passed"
@@ -29,6 +32,6 @@ class TriggerContainSpacesException(Exception):
"""
Private. Raised when there is a space in the trigger being registered
"""
def __str__(self):
@override
def __str__(self) -> str:
return "Command trigger cannot contain spaces"