Enable BLE linting rule and add noqa comments for intentional exceptions#165
Merged
Merged
Conversation
Adds flake8-blind-except (BLE) to ruff's selected rules so bare `except:`, `except Exception:`, and `except BaseException:` are flagged. Forces a deliberate choice on error handling - either narrow the exception or add `# noqa: BLE001` with a justification. Annotates the two existing legitimate broad catches (test thread error collection, observability fallback) with reason comments. https://claude.ai/code/session_01LKvQDaUrRDui7ZQRkHH4Cp
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
There was a problem hiding this comment.
No issues found across 3 files
Tip: cubic could auto-approve low-risk PRs like this, if it thinks it's safe to merge. Learn more
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
Enable the BLE (blind except) linting rule in Ruff to catch overly broad exception handling, and add appropriate
noqacomments to intentional cases where catching all exceptions is necessary.Changes
pyproject.tomlto enforce more specific exception handlingnoqa: BLE001comments to two legitimate cases where catching all exceptions is intentional:tests/test_logging_thread_safety.py: Test needs to collect any thread failure regardless of exception typeutils/llm/dspy_langfuse.py: Observability fallback must never raise, so it catches all exceptions to ensure robustnessTesting
make ci)make test)https://claude.ai/code/session_01LKvQDaUrRDui7ZQRkHH4Cp
Summary by cubic
Enable the BLE lint rule in
ruffto flag broad exception handling (Linear BAVB9). Add# noqa: BLE001to the two intentional catch-alls in tests/test_logging_thread_safety.py and utils/llm/dspy_langfuse.py.Written for commit a15b0c8. Summary will update on new commits.