core/agent+cli: give each C901 exemption a reason

This commit is contained in:
2026-10-07 00:39:30 +08:00
parent 432b703b54
commit 9fac1ecfc0
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -107,7 +107,7 @@ class TodoStack:
return self._data return self._data
@classmethod @classmethod
def from_raw(cls, raw: object | None) -> TodoStack: # noqa: C901, PLR0911 def from_raw(cls, raw: object | None) -> TodoStack: # noqa: C901, PLR0911 — three stored stack shapes
if raw is None or not isinstance(raw, dict): if raw is None or not isinstance(raw, dict):
return cls() return cls()
blob = cast("dict[str, object]", raw) blob = cast("dict[str, object]", raw)
+1 -1
View File
@@ -1083,7 +1083,7 @@ def _flush_assistant_markdown(body: str, *, pretty: bool) -> None:
click.echo() click.echo()
async def render_events( # noqa: C901, PLR0912, PLR0915 async def render_events( # noqa: C901, PLR0912, PLR0915 — one branch per event type
events: AsyncIterator[AgentEvent], events: AsyncIterator[AgentEvent],
*, *,
verbose: bool | None = None, verbose: bool | None = None,
+2 -2
View File
@@ -852,7 +852,7 @@ def provider_cmd(state: ReplState, name: str | None) -> None:
help="Merge remote (and recovered) model ids into plyngent.toml for this provider.", help="Merge remote (and recovered) model ids into plyngent.toml for this provider.",
) )
@click.pass_obj @click.pass_obj
def models_cmd(state: ReplState, *, refresh: bool, persist: bool) -> None: # noqa: C901 def models_cmd(state: ReplState, *, refresh: bool, persist: bool) -> None: # noqa: C901 — list / recover / persist
"""List models (remote-first, plus config-only ids). Always tries GET /models.""" """List models (remote-first, plus config-only ids). Always tries GET /models."""
del refresh # always re-fetch; flag kept for CLI compatibility / docs del refresh # always re-fetch; flag kept for CLI compatibility / docs
remote: list[str] | None = None remote: list[str] | None = None
@@ -1512,7 +1512,7 @@ def history_cmd(
@click.argument("action", required=False, type=TODOS_ACTION) @click.argument("action", required=False, type=TODOS_ACTION)
@click.argument("rest", required=False, nargs=-1, type=str) @click.argument("rest", required=False, nargs=-1, type=str)
@click.pass_obj @click.pass_obj
def todos_cmd( # noqa: C901, PLR0911, PLR0912, PLR0915 def todos_cmd( # noqa: C901, PLR0911, PLR0912, PLR0915 — one branch per /todos action
state: ReplState, action: str | None, rest: tuple[str, ...] state: ReplState, action: str | None, rest: tuple[str, ...]
) -> None: ) -> None:
"""Show or edit the LIFO stack of **task groups**. """Show or edit the LIFO stack of **task groups**.