close
Skip to content

Fix SIM103 lint error in issue_comment_bot.py - #13143

Merged
mekarpeles merged 1 commit into
internetarchive:masterfrom
lokesh:fix/sim103-issue-comment-bot
Jul 10, 2026
Merged

Fix SIM103 lint error in issue_comment_bot.py#13143
mekarpeles merged 1 commit into
internetarchive:masterfrom
lokesh:fix/sim103-issue-comment-bot

Conversation

@lokesh

@lokesh lokesh commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Problem

should_label_issue() in scripts/gh_scripts/issue_comment_bot.py (added in #13139) trips ruff's SIM103:

SIM103 Return the negated condition directly
   --> scripts/gh_scripts/issue_comment_bot.py:198

Because pre-commit.ci lints the whole repo (--all-files), this failure surfaces on every open PR, not just #13139. The fix isn't auto-applicable (it's a ruff "unsafe" fix), so pre-commit.ci can't self-heal it.

Fix

Collapse the if ...: return False / return True into a single negated return. No behavior change.

bot_acct = next((bot for bot in bots if bot["githubUsername"] == last_commenter), None)
return not (bot_acct and not bot_acct["triggersNeedsResponse"])

ruff check passes clean.

@lokesh
lokesh requested a review from jimchamp July 10, 2026 07:01
@mekarpeles
mekarpeles merged commit 58fda32 into internetarchive:master Jul 10, 2026
4 checks passed
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