AI-generated possible solution for #545 (B)#556
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a new optional Bugbear rule, B913, intended to warn about zip() loop variables discarded with trailing _ targets.
Changes:
- Invokes a new B913 check from
visit_For. - Adds
check_for_b913to detect trailing unused_targets infor ... in zip(...). - Registers B913 as an error code disabled by default.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ) and not any(kw.arg == "strict" for kw in node.keywords): | ||
| self.add_error("B911", node) | ||
|
|
||
| def check_for_b913(self, node: ast.For) -> None: |
| if len(call.args) != len(target_elts): | ||
| return | ||
| self.add_error("B913", node) |
|
I generally get AI to review, then sanity check code. Here I'd love some unittests please showing the check works and finds lint errors with all examples of everything it can fire on please. I think I prefer this being an optional check, so let's for with this PR. Please also address copilot's findings. |
|
Thank you so much for taking the time to review this PR and share your feedback — we genuinely appreciate it! I should have made this clearer upfront: as mentioned in our initial message, both PRs were submitted as part of a research study on how maintainers evaluate AI-generated code. They are not intended for actual merging, and we will not be able to refine or update them. We are sorry for any confusion this caused — your time is valuable. If you would like to participate in the study and share your thoughts on the two solutions, we would love to hear from you. Otherwise, please feel free to close the PRs. |
|
Yeah, that was not clear. Please improve that for others as we as maintainers have limited time and you've now taken mine for no advantage to this project. That makes me sad. |
Hi,
We're a research team at JetBrains studying how maintainers evaluate AI-generated code.
We opened two pull requests as possible solutions to the corresponding issue, each taking a different approach. Both were generated by AI and have not yet been manually reviewed by a human. We’d like to get your perspective on these two solutions via a 10-minute survey. Regardless of your role, we want to know which solution actually saves you work, and which qualities of AI-generated code matter most when working with the codebase.
If you're open to participating in our study, just reply "I'm interested" here, and we'll send the details to the contact specified in your GitHub profile. If you'd rather not take part, feel free to close the PRs – we won’t post them again.
Thanks!
Issue #545