Skip to content

Remove the two unused FastAPI exception-handler arguments #74

Description

@tschm

Subcategory: Linting/style
Score: contributes 4 → 10

Two FastAPI exception handlers declare arguments they never use. FastAPI requires the (request, exc) signature, so the fix is to prefix the unused one with an underscore (or add a targeted # noqa: ARG001 if the framework contract makes the name meaningful).

What to change

  • src/pycharting/core/server.py:213 — not_found_handler, unused exc
  • src/pycharting/core/server.py:220 — server_error_handler, unused request

Best done together with the annotation work on the same two handlers.

done when

ruff reports no ARG001 and both handlers still respond correctly (covered by tests/pycharting/core/test_server.py:159,165).

Evidence

ARG001 Unused function argument: `request`
   --> src/pycharting/core/server.py:220:36

Surfaced by the Rhiza quality gates during the template bump to jebel-quant/rhiza@v1.2.2, which enabled the stricter ruff rule families (ANN, A, BLE, ARG) and TYPECHECKER=both. Gate status at time of filing: make fmt FAIL, make typecheck FAIL, make docs-coverage FAIL, test-layout FAIL; make deptry, make security, make test PASS (154 tests, 100% coverage).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions