-
-
Notifications
You must be signed in to change notification settings - Fork 53
next release - feature parity - high testing coverage (Sourcery refactored) #175
Conversation
db7d95f to
0cb42f7
Compare
| if not has_expired: | ||
| return current_session | ||
| return await self._call_refresh_token(current_session.refresh_token) | ||
| return ( | ||
| await self._call_refresh_token(current_session.refresh_token) | ||
| if has_expired | ||
| else current_session | ||
| ) |
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 AsyncGoTrueClient.get_session refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else) - Replace if statement with if expression (
assign-if-exp) - Swap if/else branches of if expression to remove negation (
swap-if-expression)
| self._in_memory_session = session | ||
| expire_at = session.expires_at | ||
| if expire_at: | ||
| pass |
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 AsyncGoTrueClient._save_session refactored with the following changes:
- Remove redundant pass statement (
remove-redundant-pass)
| session = Session.parse_obj(data) | ||
| return session | ||
| return Session.parse_obj(data) |
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 AsyncGoTrueClient._get_valid_session refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| if name in query_params: | ||
| return query_params[name][0] | ||
| return None | ||
| return query_params[name][0] if name in query_params else None |
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 AsyncGoTrueClient._get_param refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else) - Replace if statement with if expression (
assign-if-exp)
| if not has_expired: | ||
| return current_session | ||
| return self._call_refresh_token(current_session.refresh_token) | ||
| return ( | ||
| self._call_refresh_token(current_session.refresh_token) | ||
| if has_expired | ||
| else current_session | ||
| ) |
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 SyncGoTrueClient.get_session refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else) - Replace if statement with if expression (
assign-if-exp) - Swap if/else branches of if expression to remove negation (
swap-if-expression)
| self._in_memory_session = session | ||
| expire_at = session.expires_at | ||
| if expire_at: | ||
| pass |
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 SyncGoTrueClient._save_session refactored with the following changes:
- Remove redundant pass statement (
remove-redundant-pass)
| session = Session.parse_obj(data) | ||
| return session | ||
| return Session.parse_obj(data) |
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 SyncGoTrueClient._get_valid_session refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| if name in query_params: | ||
| return query_params[name][0] | ||
| return None | ||
| return query_params[name][0] if name in query_params else None |
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 SyncGoTrueClient._get_param refactored with the following changes:
- Lift code into else after jump in control flow (
reintroduce-else) - Replace if statement with if expression (
assign-if-exp)
| email=email, | ||
| password=password + "2", | ||
| ) | ||
| await client.sign_in(email=email, password=f"{password}2") |
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 test_sign_in_with_the_wrong_password refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
| email=email, | ||
| password=password + "2", | ||
| ) | ||
| client.sign_in(email=email, password=f"{password}2") |
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 test_sign_in_with_the_wrong_password refactored with the following changes:
- Use f-string instead of string concatenation (
use-fstring-for-concatenation)
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.02%.
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! Help us improve this quality report! |
Pull Request #148 refactored by Sourcery.
If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.
NOTE: As code is pushed to the original Pull Request, Sourcery will
re-run and update (force-push) this Pull Request with new refactorings as
necessary. If Sourcery finds no refactorings at any point, this Pull Request
will be closed automatically.
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
nextbranch, then run:Help us improve this pull request!