chore(lint): enable PERF203 rule (no try-except in loops)#1059
chore(lint): enable PERF203 rule (no try-except in loops)#1059Aaron ("AJ") Steers (aaronsteers) wants to merge 2 commits into
Conversation
Un-ignore PERF203 which flags try/except blocks inside for/while loops. Moving exception handling outside loops improves performance and aligns with the org's guard-statement-over-try-except standard. 70 existing violations need compliance fixes. Co-Authored-By: AJ Steers <aj@airbyte.io>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
Warning Review limit reached
Next review available in: 8 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1783311542-ruff-enable-perf203' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1783311542-ruff-enable-perf203'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
| "NPY", # NumPy-specific rules | ||
| "PIE790", # Allow unnecssary 'pass' (sometimes useful for readability) | ||
| "PERF203", # exception handling in loop | ||
| # "PERF203", # exception handling in loop (now enforced) |
There was a problem hiding this comment.
Move to explicit 'select' list rather than commenting-out the ignore.
There was a problem hiding this comment.
☑️ Resolved. Will remove from ignore entirely and add explicit \"PERF203\" to the select list. Applying this pattern to all PRs in the series.
Per review feedback: remove from ignore entirely instead of commenting out. PERF203 is already selected via the PERF category. Co-Authored-By: AJ Steers <aj@airbyte.io>
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-fastThe overall coverage in the branch is 67%. The coverage in the branch is 65%. Show a code coverage summary of the most impacted files.
Python / code-coverage/pytest-no-credsThe overall coverage in the branch is 67%. The coverage in the branch is 65%. Show a code coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall coverage in the branch is 72%. The coverage in the branch is 71%. Show a code coverage summary of the most impacted files.
Updated |
Summary
Un-ignore
PERF203which flagstry/exceptblocks insidefor/whileloops. Exception handling in loops has a measurable performance cost and often indicates code that should use guard statements instead.70 existing violations. PR B (stacked on this branch) will add
noqadirectives for existing violations.Link to Devin session: https://app.devin.ai/sessions/6ae2048fc77a4f278aee3dd022384f4a
Requested by: Aaron ("AJ") Steers (@aaronsteers)