Skip to content

Fix EM102: extract exception f-strings into variables#207

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/em102-fix-linter-error-again
Draft

Fix EM102: extract exception f-strings into variables#207
Copilot wants to merge 2 commits intomainfrom
copilot/em102-fix-linter-error-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 7, 2026

Ruff rule EM102 prohibits f-string literals as direct exception arguments (they bloat tracebacks). This removes EM102 from the pyproject.toml suppression list and fixes all 42 violations across 14 files.

Pattern applied

# Before
raise ValueError(f"No such reusable taskflow: {task.uses}")

# After
msg = f"No such reusable taskflow: {task.uses}"
raise ValueError(msg)

Files changed

  • pyproject.toml — removed EM102 from [tool.ruff.lint] ignore
  • agent.py, available_tools.py, cli.py, mcp_lifecycle.py, mcp_transport.py, mcp_utils.py, models.py, runner.py, session.py, shell_utils.py, template_utils.py — first-party fixes
  • mcp_servers/codeql/client.py, mcp_servers/codeql/mcp_server.py, mcp_servers/codeql/jsonrpyc/__init__.py — MCP server fixes

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • unsupported.example.com
    • Triggering command: /usr/bin/python python -m pytest tests/ -x -q (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 7, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix linter error EM102 and remove from suppression list Fix EM102: extract exception f-strings into variables Apr 7, 2026
Copilot AI requested a review from kevinbackhouse April 7, 2026 11:28
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.

EM102

2 participants