Skip to content

Chore: Enable ruff E402 and E722; clarify mcp_proxy_requests_total docs - #707

Merged
satoseino merged 3 commits into
mainfrom
chore/ruff-rule-and-doc-change
Nov 27, 2026
Merged

satoseino merged 3 commits into
mainfrom
chore/ruff-rule-and-doc-change

Conversation

@satoseino

Copy link
Copy Markdown
Collaborator
  • Enable E402 (module-level import not at top of file):
    • Moved misplaced imports in registry_pkgs/models/a2a_agent.py and five test files. In four of those tests an import sat above the module docstring, which also stopped the docstring from counting as the module docstring.
    • Exempted scripts/* in per-file-ignores. The scripts run load_dotenv() or set environment variables before importing app modules that read settings when imported.
    • Added # noqa: E402 to the deliberately late imports in registry/tests/conftest.py (test env setup must run first) and registry/tests/unit/search/test_faiss_service.py (sys.modules mocking must run first).
  • Enable E722 (bare except): there were no existing violations.
  • Telemetry README: the mcp_proxy_requests_total row now says the metric counts requests the direct proxy handled, not only those it sent. Requests that need downstream authorization are counted as input_required and outbound-auth errors as failure. Other refusals before forwarding (ACL, consent, transport, Accept header) are not counted.

uv run poe check passes, and uv run poe test-all passes in every workspace.

Fix misplaced imports; exempt scripts/* (they load .env before importing
app modules) and noqa the intentional late imports in registry/tests/conftest.py
and test_faiss_service.py.
No existing violations.
@satoseino
satoseino merged commit 0978eda into main Nov 27, 2026
7 checks passed
@satoseino
satoseino deleted the chore/ruff-rule-and-doc-change branch November 27, 2026 02:53
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