Skip to content

Fix linter error EM101 and remove suppression from pyproject.toml#256

Draft
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-linter-error-em101-again
Draft

Fix linter error EM101 and remove suppression from pyproject.toml#256
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-linter-error-em101-again

Conversation

Copilot AI commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

EM101 (exception must not use a string literal) was suppressed globally in pyproject.toml rather than fixed. This removes the suppression and resolves all 18 violations across the codebase.

Changes

  • All source files: Assign exception message strings to a msg variable before raising, per EM101 convention:

    # Before
    raise ValueError("Reusable taskflows can only contain 1 task")
    
    # After
    msg = "Reusable taskflows can only contain 1 task"
    raise ValueError(msg)

    Affected: _stream.py, capi.py, mcp_servers/codeql/client.py, mcp_transport.py, models.py, runner.py, sdk/copilot_sdk/backend.py, tests/test_sdk_copilot_adapter.py

  • pyproject.toml: Remove EM101 from the ignore list.

  • client.py (bonus fix): "Unsupported output format {fmt}" was missing the f prefix — fmt was never interpolated. Changed to f"Unsupported output format {fmt}".

Copilot AI review requested due to automatic review settings June 1, 2026 13:36
Copilot AI review requested due to automatic review settings June 1, 2026 13:36
Copilot AI linked an issue Jun 1, 2026 that may be closed by this pull request
Copilot AI requested review from Copilot and removed request for Copilot June 1, 2026 13:55
Copilot AI changed the title [WIP] Fix linter error EM101 and remove from suppression list Fix linter error EM101 and remove suppression from pyproject.toml Jun 1, 2026
Copilot AI requested a review from kevinbackhouse June 1, 2026 13:57
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.

Fix linter error EM101

2 participants