-
Notifications
You must be signed in to change notification settings - Fork 531
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
STY: Apply ruff/refurb rules #3648
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3648 +/- ##
=======================================
Coverage 70.90% 70.90%
=======================================
Files 1277 1277
Lines 59477 59455 -22
Branches 9819 9824 +5
=======================================
- Hits 42172 42157 -15
+ Misses 16134 16122 -12
- Partials 1171 1176 +5 ☔ View full report in Codecov by Sentry. |
FURB113 Use `list.extend(...)` instead of repeatedly calling `list.append()`
FURB148 `enumerate` index is unused, use `for x in y` instead
FURB129 Instead of calling `readlines()`, iterate over file object directly
FURB167 Use of regular expression alias `re.X` FURB167 Use of regular expression alias `re.M`
FURB136 Replace `20 if len(nodiffidx) >= 20 else len(nodiffidx)` with `min(20, len(nodiffidx))`
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.
Looks good. A couple small suggestions, but this could go in as-is.
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Summary
Partially apply
FURB
rules, where they make sense, exceptFURB101
(26 errors),FURB103
(21 errors),FURB113
(2 errors),FURB118
(3 errors),FURB140
(2 errors),FURB171
(25 errors).List of changes proposed in this PR (pull-request)
FURB113 Use
list.extend(...)
instead of repeatedly callinglist.append()
FURB129 Instead of calling
readlines()
, iterate over file object directlyFURB136 Replace
20 if len(nodiffidx) >= 20 else len(nodiffidx)
withmin(20, len(nodiffidx))
FURB148
enumerate
index is unused, usefor x in y
insteadFURB167 Use of regular expression alias
re.X
FURB167 Use of regular expression alias
re.M