feat: add --my-tasks mode for open assigned issues (#71)
List open Redmine issues assigned to the current (or overridden) user, sorted by priority rank (P1..P5) then version due date with a stable id tie-break. Renders an OSC 8 hyperlinked console table on stdout and a counts/hours summary line on stderr; version due dates are fetched once per unique version, unavailable versions degrade to an empty due date. Also migrates the codebase to ruff 0.17.3 defaults (PEP 585/604 annotations, targeted noqa for intentional blind excepts and CLI root logging). Behavior-neutral: 408 tests pass with -W error.
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
from typing import Dict, Optional, Type
|
||||
|
||||
from .base import Formatter
|
||||
from .console import CompactFormatter, TableFormatter
|
||||
from .csv import CSVFormatter
|
||||
@@ -11,7 +9,7 @@ from .xlsx import XLSXFormatter
|
||||
# Словарь для сопоставления расширений файлов с классами форматтеров.
|
||||
# ODT и XLSX намеренно отсутствуют — их импорт отложен (ленивый), так как
|
||||
# odfpy/openpyxl может быть не установлен. См. get_formatter_by_extension.
|
||||
FORMATTER_MAP: Dict[str, Type[Formatter]] = {
|
||||
FORMATTER_MAP: dict[str, type[Formatter]] = {
|
||||
".csv": CSVFormatter,
|
||||
".json": JSONFormatter,
|
||||
".md": MarkdownFormatter,
|
||||
@@ -21,13 +19,13 @@ FORMATTER_MAP: Dict[str, Type[Formatter]] = {
|
||||
|
||||
|
||||
# Словарь для сопоставления типа вывода (консоль) с классами форматтеров
|
||||
CONSOLE_FORMATTER_MAP: Dict[str, Type[Formatter]] = {
|
||||
CONSOLE_FORMATTER_MAP: dict[str, type[Formatter]] = {
|
||||
"table": TableFormatter,
|
||||
"compact": CompactFormatter,
|
||||
}
|
||||
|
||||
|
||||
def get_formatter_by_extension(extension: str, **kwargs) -> Optional[Formatter]:
|
||||
def get_formatter_by_extension(extension: str, **kwargs) -> Formatter | None:
|
||||
"""
|
||||
Возвращает экземпляр форматтера по расширению файла.
|
||||
Ключевые аргументы (**kwargs) передаются в конструктор форматтера.
|
||||
@@ -51,7 +49,7 @@ def get_formatter_by_extension(extension: str, **kwargs) -> Optional[Formatter]:
|
||||
return None
|
||||
|
||||
|
||||
def get_console_formatter(formatter_type: str) -> Optional[Formatter]:
|
||||
def get_console_formatter(formatter_type: str) -> Formatter | None:
|
||||
"""
|
||||
Возвращает экземпляр консольного форматтера по его типу.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user