-
Notifications
You must be signed in to change notification settings - Fork 0
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
Sourcery refactored master branch #9
base: master
Are you sure you want to change the base?
Conversation
return False if self._workers else True | ||
return not self._workers |
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.
Function BaseWorkerManager.are_all_workers_closed
refactored with the following changes:
- Simplify boolean if expression (
boolean-if-exp-identity
)
if self._awaitable: | ||
if not compat.PY36: | ||
return self._MapAsyncIterator(futures, end_time, self._loop) | ||
return self._map_async_gen(futures, end_time) | ||
else: | ||
if not self._awaitable: | ||
return self._map_gen(futures, end_time) | ||
|
||
if not compat.PY36: | ||
return self._MapAsyncIterator(futures, end_time, self._loop) | ||
return self._map_async_gen(futures, end_time) |
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.
Function BaseAsyncPoolExecutor.map
refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
)
results = tuple(j for j in map_results) | ||
results = tuple(map_results) |
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.
Function TestMap.test_map_return_order
refactored with the following changes:
- Simplify generator expression (
simplify-generator
)
if awaitable: | ||
concurrent_fut = future._future | ||
else: | ||
concurrent_fut = future | ||
|
||
concurrent_fut = future._future if awaitable else future |
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.
Function TestCancel.test_cancel_running
refactored with the following changes:
- Replace if statement with if expression (
assign-if-exp
)
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.15%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
Branch
master
refactored by Sourcery.If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
See our documentation here.
Run Sourcery locally
Reduce the feedback loop during development by using the Sourcery editor plugin:
Review changes via command line
To manually merge these changes, make sure you're on the
master
branch, then run: