diff --git a/pyproject.toml b/pyproject.toml index 4dda81f..ed93af9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -136,6 +136,9 @@ ignore = [ "COM812", # missing-trailing-comma "PLC0415", # import-outside-top-level "TID252", + # Same axis as C901 (conditional branches per function) but a looser default, + # and C901 flags every function it does — keep the one gate (see AGENTS.md). + "PLR0912", # too-many-branches "PLR0913", # too-many-arguments (common on constructors/composed functions) ] allowed-confusables = [ diff --git a/src/plyngent/agent/loop.py b/src/plyngent/agent/loop.py index 4bc72b5..b3cda4f 100644 --- a/src/plyngent/agent/loop.py +++ b/src/plyngent/agent/loop.py @@ -425,7 +425,7 @@ async def _maybe_inject_directive_checkpoints( return new_band -async def run_chat_loop( # noqa: C901, PLR0912 — multi-phase tool loop +async def run_chat_loop( # noqa: C901 — multi-phase tool loop client: AnyLLMClient, messages: list[AnyChatMessage], *, diff --git a/src/plyngent/cli/app.py b/src/plyngent/cli/app.py index a8aa5d2..46f21a2 100644 --- a/src/plyngent/cli/app.py +++ b/src/plyngent/cli/app.py @@ -218,7 +218,7 @@ async def _run_oneshot(state: ReplState, prompt_text: str) -> int: return EXIT_OK if ok else EXIT_TURN_FAILED -async def _run_chat( # noqa: C901, PLR0912, PLR0915 — chat orchestration +async def _run_chat( # noqa: C901, PLR0915 — chat orchestration *, config_path: Path | None, provider_name: str | None, diff --git a/src/plyngent/cli/display.py b/src/plyngent/cli/display.py index 8ce0cc9..0cc8244 100644 --- a/src/plyngent/cli/display.py +++ b/src/plyngent/cli/display.py @@ -1083,7 +1083,7 @@ def _flush_assistant_markdown(body: str, *, pretty: bool) -> None: click.echo() -async def render_events( # noqa: C901, PLR0912, PLR0915 — one branch per event type +async def render_events( # noqa: C901, PLR0915 — one branch per event type events: AsyncIterator[AgentEvent], *, verbose: bool | None = None, diff --git a/src/plyngent/cli/slash.py b/src/plyngent/cli/slash.py index 1802cee..15ad642 100644 --- a/src/plyngent/cli/slash.py +++ b/src/plyngent/cli/slash.py @@ -1512,7 +1512,7 @@ def history_cmd( @click.argument("action", required=False, type=TODOS_ACTION) @click.argument("rest", required=False, nargs=-1, type=str) @click.pass_obj -def todos_cmd( # noqa: C901, PLR0911, PLR0912, PLR0915 — one branch per /todos action +def todos_cmd( # noqa: C901, PLR0911, PLR0915 — one branch per /todos action state: ReplState, action: str | None, rest: tuple[str, ...] ) -> None: """Show or edit the LIFO stack of **task groups**.