Skip to content

Enable BLE linting rule and add noqa comments for intentional exceptions#165

Merged
Miyamura80 merged 1 commit into
mainfrom
claude/add-catch-all-linter-rule-BAVB9
May 11, 2026
Merged

Enable BLE linting rule and add noqa comments for intentional exceptions#165
Miyamura80 merged 1 commit into
mainfrom
claude/add-catch-all-linter-rule-BAVB9

Conversation

@Miyamura80
Copy link
Copy Markdown
Owner

@Miyamura80 Miyamura80 commented May 11, 2026

Summary

Enable the BLE (blind except) linting rule in Ruff to catch overly broad exception handling, and add appropriate noqa comments to intentional cases where catching all exceptions is necessary.

Changes

  • Added "BLE" to the Ruff lint rules in pyproject.toml to enforce more specific exception handling
  • Added noqa: BLE001 comments 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 type
    • utils/llm/dspy_langfuse.py: Observability fallback must never raise, so it catches all exceptions to ensure robustness

Testing

  • Linting passes (make ci)
  • Tests pass (make test)

https://claude.ai/code/session_01LKvQDaUrRDui7ZQRkHH4Cp


Summary by cubic

Enable the BLE lint rule in ruff to flag broad exception handling (Linear BAVB9). Add # noqa: BLE001 to 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.

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
@qodo-code-review
Copy link
Copy Markdown

ⓘ 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.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Miyamura80 Miyamura80 merged commit 80eda12 into main May 11, 2026
13 checks passed
@github-actions github-actions Bot deleted the claude/add-catch-all-linter-rule-BAVB9 branch May 11, 2026 18:22
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.

2 participants