Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Feb 6, 2022
1 parent 86db58e commit ee80e87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
7 changes: 1 addition & 6 deletions src/darker/black_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@

def find_project_root(srcs: Sequence[str]) -> Path:
root = black_find_project_root(tuple(srcs or ["."]))
if isinstance(root, tuple):
# Black >= 22.1
return root[0]
else:
# Black < 22
return root
return root[0] if isinstance(root, tuple) else root

find_project_root.cache_clear = black_find_project_root.cache_clear
4 changes: 2 additions & 2 deletions src/darker/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_format_edited_parts_all_unchanged(git_repo, monkeypatch):
)
)

assert result == []
assert not result


def test_format_edited_parts_ast_changed(git_repo, caplog):
Expand Down Expand Up @@ -273,7 +273,7 @@ def test_format_edited_parts_isort_on_already_formatted(git_repo):
report_unmodified=False,
)

assert list(result) == []
assert not list(result)


@pytest.mark.kwparametrize(
Expand Down

0 comments on commit ee80e87

Please sign in to comment.