-
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 SIM300 #9834
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
anthonyburdi
requested review from
TrangPham,
billdirks,
Kilo59 and
NathanFarmer
April 29, 2024 17:34
✅ Deploy Preview for niobium-lead-7998 canceled.
|
TrangPham
approved these changes
Apr 29, 2024
NathanFarmer
approved these changes
Apr 29, 2024
Kilo59
approved these changes
Apr 29, 2024
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #9834 +/- ##
========================================
Coverage 82.54% 82.54%
========================================
Files 504 504
Lines 45097 45097
========================================
Hits 37227 37227
Misses 7870 7870
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://docs.astral.sh/ruff/rules/yoda-conditions/
yoda-conditions (SIM300)
Derived from the flake8-simplify linter.
Fix is sometimes available.
What it does
Checks for conditions that position a constant on the left-hand side of the
comparison operator, rather than the right-hand side.
Why is this bad?
These conditions (sometimes referred to as "Yoda conditions") are less
readable than conditions that place the variable on the left-hand side of
the comparison operator.
In some languages, Yoda conditions are used to prevent accidental
assignment in conditions (i.e., accidental uses of the
=
operator,instead of the
==
operator). However, Python does not allow assignmentsin conditions unless using the
:=
operator, so Yoda conditions provideno benefit in this regard.
Example
Use instead:
References