Skip to content

fix: clear ruff F811/F841 findings across frontends and helpers#569

Open
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/ruff-f811-f841-cleanup
Open

fix: clear ruff F811/F841 findings across frontends and helpers#569
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/ruff-f811-f841-cleanup

Conversation

@Kailigithub
Copy link
Copy Markdown
Contributor

fix: clear ruff F811/F841 findings across frontends and helpers

Resolve all F811 (redefined-while-unused) and F841 (unused-local) issues
reported by ruff so the lint baseline is cleaner:

  • frontends/tui_v3.py: drop a duplicate from dataclasses import dataclass line that was shadowed by the very next import; remove the
    dead from prompt_toolkit.keys import Keys block in
    _ptk_keypress_to_bytes — the symbol was never referenced in the
    function body, only getattr(kp, 'key', None) is used.
  • frontends/fsapp.py: handle_message unpacks data.event but never reads
    the event object — rename to _event to flag intent.
  • frontends/genericagent_acp_bridge.py: write_message computed method
    but only logged the payload — embed method in the ACP-BRIDGE log line
    so the local is used and debugging is easier.
  • frontends/qtapp.py: drop unused as e from an exception handler that
    already prints via traceback.print_exc().
  • frontends/tuiapp.py: drop the unused args assignment in main();
    parse_args still validates argv and surfaces errors.
  • memory/autonomous_operation_sop/helper.py: remove an unused errors
    list in complete_task.

Verification:

  • python3 -m py_compile on all six files passes.
  • ruff check <files> --select F811,F841 reports All checks passed!.
  • No behavioural change; the only logic tweak is the ACP-BRIDGE log
    gaining a [method] prefix.

Resolve all F811 (redefined-while-unused) and F841 (unused-local) issues
reported by ruff so the lint baseline is cleaner:

- frontends/tui_v3.py: drop a duplicate `from dataclasses import
  dataclass` line that was shadowed by the very next import; remove the
  dead `from prompt_toolkit.keys import Keys` block in
  _ptk_keypress_to_bytes — the symbol was never referenced in the
  function body, only `getattr(kp, 'key', None)` is used.
- frontends/fsapp.py: handle_message unpacks data.event but never reads
  the event object — rename to `_event` to flag intent.
- frontends/genericagent_acp_bridge.py: write_message computed `method`
  but only logged the payload — embed method in the ACP-BRIDGE log line
  so the local is used and debugging is easier.
- frontends/qtapp.py: drop unused `as e` from an exception handler that
  already prints via traceback.print_exc().
- frontends/tuiapp.py: drop the unused `args` assignment in main();
  parse_args still validates argv and surfaces errors.
- memory/autonomous_operation_sop/helper.py: remove an unused `errors`
  list in complete_task.

Verification:
- `python3 -m py_compile` on all six files passes.
- `ruff check <files> --select F811,F841` reports `All checks passed!`.
- No behavioural change; the only logic tweak is the ACP-BRIDGE log
  gaining a `[method]` prefix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant