-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MAINTENANCE] Enable SIM110 #9836
Conversation
✅ Deploy Preview for niobium-lead-7998 canceled.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #9836 +/- ##
===========================================
- Coverage 82.54% 82.15% -0.40%
===========================================
Files 504 504
Lines 45097 45082 -15
===========================================
- Hits 37227 37037 -190
- Misses 7870 8045 +175
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if target.startswith(quote) and target.endswith(quote): | ||
return True | ||
return False | ||
return any(target.startswith(quote) and target.endswith(quote) for quote in ["`"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove loop altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
https://docs.astral.sh/ruff/rules/reimplemented-builtin/
reimplemented-builtin (SIM110)
Derived from the flake8-simplify linter.
Fix is sometimes available.
What it does
Checks for
for
loops that can be replaced with a builtin function, likeany
orall
.Why is this bad?
Using a builtin function is more concise and readable. Builtins are also
more efficient than
for
loops.Example
Use instead:
References
any
all