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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user