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 List
|
||||
|
||||
from tabulate import tabulate
|
||||
|
||||
from ..types import ReportRow
|
||||
@@ -9,7 +7,7 @@ from .base import Formatter
|
||||
class TableFormatter(Formatter):
|
||||
"""Форматтер для вывода красивой таблицы в консоль."""
|
||||
|
||||
def format(self, rows: List[ReportRow]) -> str:
|
||||
def format(self, rows: list[ReportRow]) -> str:
|
||||
table_rows = [["Проект", "Версия", "Задача", "Статус", "Затрачено"]]
|
||||
for r in rows:
|
||||
time_text = r["time_text"].replace("\n", " / ")
|
||||
@@ -24,7 +22,7 @@ class TableFormatter(Formatter):
|
||||
)
|
||||
return tabulate(table_rows, headers="firstrow", tablefmt="fancy_grid")
|
||||
|
||||
def save(self, rows: List[ReportRow], output_path: str) -> None:
|
||||
def save(self, rows: list[ReportRow], output_path: str) -> None:
|
||||
# Консольные форматтеры не умеют сохранять в файл напрямую.
|
||||
# Это делается в CLI.
|
||||
raise NotImplementedError("TableFormatter не поддерживает сохранение в файл.")
|
||||
@@ -33,7 +31,7 @@ class TableFormatter(Formatter):
|
||||
class CompactFormatter(Formatter):
|
||||
"""Форматтер для компактного вывода в консоль."""
|
||||
|
||||
def format(self, rows: List[ReportRow]) -> str:
|
||||
def format(self, rows: list[ReportRow]) -> str:
|
||||
lines = []
|
||||
for r in rows:
|
||||
time_text = r["time_text"].replace("\n", " / ")
|
||||
@@ -43,7 +41,7 @@ class CompactFormatter(Formatter):
|
||||
)
|
||||
return "\n".join(lines)
|
||||
|
||||
def save(self, rows: List[ReportRow], output_path: str) -> None:
|
||||
def save(self, rows: list[ReportRow], output_path: str) -> None:
|
||||
# Консольные форматтеры не умеют сохранять в файл напрямую.
|
||||
# Это делается в CLI.
|
||||
raise NotImplementedError("CompactFormatter не поддерживает сохранение в файл.")
|
||||
|
||||
Reference in New Issue
Block a user