chore: remove dead else branch in print_suggestion() - #487
Conversation
✅ Deploy Preview for commit-check ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
Next review available in: 56 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. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthrough
ChangesSuggestion handling cleanup
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #487 +/- ##
==========================================
+ Coverage 97.19% 97.27% +0.08%
==========================================
Files 12 12
Lines 1177 1175 -2
==========================================
- Hits 1144 1143 -1
+ Misses 33 32 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
shenxianpeng
left a comment
There was a problem hiding this comment.
Thanks for your contribution!
fix: use pull_request_target for auto-labeler on fork PRs When a PR is opened from a fork repository, the GITHUB_TOKEN in pull_request events only has read permissions, preventing the autolabeler from adding labels. Using pull_request_target runs the workflow in the context of the base repository with write permissions, which is safe since the autolabeler only reads PR metadata and adds labels without checking out any code. Fixes auto-labeler failing on PR #487 from a fork.
修复issue486的问题,删掉了已经判断过而不可能进入的print_suggestion函数中的else分支,测试脚本已一并改动 (Machine translation / 机器翻译) Removed the unreachable else branch in print_suggestion() that could never be entered since all callers already guard with a truthy check. Updated the type hint from str | None to str, and removed the corresponding test. Close commit-check#486
修复了mypy提到的错误,虽然本来也能跑,但现在_print_failure最后的print_suggestion传入的参数固定为str了 Fix the mypy error: the argument passed to print_suggestion in _print_failure is now guaranteed to be str (still works at runtime, just shuts up the type checker).
ffc9e40 to
75032a3
Compare
|
Merging this PR will improve performance by 36.99%
Performance Changes
Tip Curious why this is faster? Comment Comparing Footnotes
|



修复issue486的问题,删掉了已经判断过而不可能进入的print_suggestion函数中的else分支,测试脚本已一并改动
(Machine translation / 机器翻译)
Removed the unreachable else branch in print_suggestion() that could never
be entered since all callers already guard with a truthy check. Updated the
type hint from str | None to str, and removed the corresponding test.
Close #486
Summary by CodeRabbit