-
Notifications
You must be signed in to change notification settings - Fork 0
Sourcery refactored master branch #14
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
base: master
Are you sure you want to change the base?
Conversation
board = [[None for x in range(BOARD_SIZE)] for y in range(BOARD_SIZE)] | ||
board = [[None for _ in range(BOARD_SIZE)] for _ in range(BOARD_SIZE)] |
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 Game.board
refactored with the following changes:
- Replace unused for index with underscore [×2] (
for-index-underscore
)
if form.is_valid(): | ||
move.save() | ||
return redirect("gameplay_detail", id) | ||
else: | ||
if not form.is_valid(): | ||
return render( | ||
request, "gameplay/game_detail.html", {"game": game, "form": form} | ||
) | ||
move.save() | ||
return redirect("gameplay_detail", id) |
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 make_move
refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
)
if request.method == "POST": | ||
if "accept" in request.POST: | ||
game = Game.manager.create( | ||
firstPlayer=invitation.toUser, secondPlayer=invitation.fromUser, | ||
) | ||
invitation.delete() | ||
return redirect(game) | ||
else: | ||
if request.method != "POST": | ||
return render( | ||
request, "player/accept_invitation_form.html", {"invitation": invitation} | ||
) | ||
if "accept" in request.POST: | ||
game = Game.manager.create( | ||
firstPlayer=invitation.toUser, secondPlayer=invitation.fromUser, | ||
) | ||
invitation.delete() | ||
return redirect(game) |
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 accept_invitation
refactored with the following changes:
- Swap if/else branches (
swap-if-else-branches
) - Remove unnecessary else after guard condition (
remove-unnecessary-else
)
x = 5 | ||
y = 6 | ||
assert x + 1 == y, "test failed" | ||
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 test_file1_method1
refactored with the following changes:
- Inline variable that is only used once [×2] (
inline-variable
) - Remove
assert True
statements (remove-assert-true
) - Simplify numeric comparison (
simplify-numeric-comparison
) - Simplify x == x -> True and x != x -> False (
equality-identity
)
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:Help us improve this pull request!