Sourcery Starbot ⭐ refactored dericf/twitter-clone-server-fastapi#13
Sourcery Starbot ⭐ refactored dericf/twitter-clone-server-fastapi#13SourceryAI wants to merge 1 commit into
Conversation
| # user exists - proceed to return tweets | ||
| tweets = db.query(models.Tweet).filter(models.Tweet.user_id == user_id).order_by( | ||
| return db.query(models.Tweet).filter(models.Tweet.user_id == user_id).order_by( | ||
| models.Tweet.created_at.desc()).limit(limit).all() | ||
| return tweets |
There was a problem hiding this comment.
Function get_tweets_for_user refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
This removes the following comments ( why? ):
# user exists - proceed to return tweets
| # User is valid - proceed to get all followers | ||
| db_followers = db.query(models.Follows).filter( | ||
| return db.query(models.Follows).filter( | ||
| models.Follows.follows_user_id == user_id).all() | ||
| return db_followers |
There was a problem hiding this comment.
Function get_all_followers refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
This removes the following comments ( why? ):
# User is valid - proceed to get all followers
| encoded_jwt = jwt.encode( | ||
| return jwt.encode( | ||
| to_encode, settings.SECRET_KEY, algorithm=ALGORITHM) | ||
| return encoded_jwt |
There was a problem hiding this comment.
Function create_access_token refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
| # Update user attributes | ||
| user = crud.update_user(db, current_user.id, request_body) | ||
| return user | ||
| return crud.update_user(db, current_user.id, request_body) |
There was a problem hiding this comment.
Function update_user refactored with the following changes:
- Inline variable that is immediately returned (
inline-immediately-returned-variable)
This removes the following comments ( why? ):
# Update user attributes
Sourcery Code Quality Report✅ Merging this PR will increase code quality in the affected files by 0.13%.
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! |
Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨
Here's your pull request refactoring your most popular Python repo.
If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.
Review changes via command line
To manually merge these changes, make sure you're on the
masterbranch, then run: