Skip to content

Commit

Permalink
Merge pull request #1747 from PyCQA/deepsource-fix-d38dee98
Browse files Browse the repository at this point in the history
Refactor unnecessary `else` / `elif` when `if` block has a `return` statement
  • Loading branch information
timothycrosley committed Jun 16, 2021
2 parents 3acc03a + f600f2d commit 945c711
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions isort/wrap_modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,16 @@ def hanging_indent(**interface):
line_length_limit + 2
):
return statement_with_comments
else:
return (
_hanging_indent_end_line(interface["statement"])
+ interface["line_separator"]
+ isort.comments.add_to_line(
interface["comments"],
interface["indent"],
removed=interface["remove_comments"],
comment_prefix=interface["comment_prefix"].lstrip(),
)
return (
_hanging_indent_end_line(interface["statement"])
+ interface["line_separator"]
+ isort.comments.add_to_line(
interface["comments"],
interface["indent"],
removed=interface["remove_comments"],
comment_prefix=interface["comment_prefix"].lstrip(),
)
)
return interface["statement"]


Expand Down

0 comments on commit 945c711

Please sign in to comment.