Skip to content

fix(mcp-client): make slackbot MCP examples pass ruff 0.16 - #160

Merged
zimeg merged 1 commit into
mainfrom
fix/ruff-016-remove-unused-e402-noqa
Aug 1, 2026
Merged

fix(mcp-client): make slackbot MCP examples pass ruff 0.16#160
zimeg merged 1 commit into
mainfrom
fix/ruff-016-remove-unused-e402-noqa

Conversation

@zimeg

@zimeg zimeg commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary

The ruff 0.16.0 bump breaks CI on the slackbot-mcp-client examples (surfaced by the Dependabot bump in #150 — its pytest@python3.14 (…/mcp-apps) job fails). Root cause is ruff 0.16's expanded default rule set:

  • **RUF100 — Unused \noqa` directive (non-enabled: E402)**: ruff 0.16 drops E402from the default rules, so the# noqa: E402on the post-mockfrom src.app import app` import is now unused and RUF100 fails the build. Fixed by removing the directive from all three test files.
  • BLE001 — Do not catch blind exception: Exception (slack-identity/src/app.py): newly enabled by 0.16. Fixed by narrowing except Exceptionexcept (SlackApiError, ValueError, KeyError), the errors the WebClient call + profile lookup can actually raise (unexpected errors now propagate, which is the point of the rule).

Also bumps ruff to 0.16.0 in all three mcp-client requirements.txt so each directory is internally consistent (0.16 + no E402 noqa), superseding the partial bump in #150.

Validation

Ran the full CI sequence per directory (no-auth, rich-responses/mcp-apps, slack-identity) with ruff 0.16.0:

  • ruff check — All checks passed
  • ruff format --diff --check — already formatted
  • mypy — no issues
  • pytest — all pass

Related

🤖 Generated with Claude Code

ruff 0.16 expands the default rule set and drops E402 from it, which
broke CI on the ruff-0.16 bump (e.g. #150):

- RUF100 'unused noqa (non-enabled: E402)' — E402 is no longer a default
  rule, so the '# noqa: E402' on the post-mock `from src.app import app`
  imports is now unused. Remove it from all three test files.
- BLE001 'do not catch blind exception' (slack-identity/src/app.py) —
  narrow `except Exception` to `(SlackApiError, ValueError, KeyError)`,
  the errors the WebClient/profile lookup can actually raise.

Bumps ruff to 0.16.0 in all three mcp-client requirements so each dir is
internally consistent (0.16 + no E402 noqa), superseding the partial
Dependabot bump in #150. Verified per dir: ruff check + ruff format
--check + mypy + pytest all pass.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg requested a review from a team as a code owner August 1, 2026 01:35
@zimeg zimeg self-assigned this Aug 1, 2026
@zimeg zimeg added the dependencies Pull requests that update a dependency file label Aug 1, 2026
@zimeg
zimeg merged commit ecf9b88 into main Aug 1, 2026
6 checks passed
@zimeg
zimeg deleted the fix/ruff-016-remove-unused-e402-noqa branch August 1, 2026 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant