fix(mcp-client): make slackbot MCP examples pass ruff 0.16 - #160
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:Unused \noqa` directive (non-enabled: E402)**: ruff 0.16 dropsE402from 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.Do not catch blind exception: Exception(slack-identity/src/app.py): newly enabled by 0.16. Fixed by narrowingexcept Exception→except (SlackApiError, ValueError, KeyError), the errors theWebClientcall + profile lookup can actually raise (unexpected errors now propagate, which is the point of the rule).Also bumps
ruffto0.16.0in all three mcp-clientrequirements.txtso 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 passedruff format --diff --check— already formattedmypy— no issuespytest— all passRelated
🤖 Generated with Claude Code