Skip to content

Commit 3edc872

Browse files
CM-55207-Ruff fix
1 parent d389946 commit 3edc872

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

cycode/cli/files_collector/commit_range_documents.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,8 @@ def parse_commit_range(commit_range: str, path: str) -> tuple[Optional[str], Opt
461461
if all_commits:
462462
first_commit = all_commits.splitlines()[0]
463463
return first_commit, head_commit, '..'
464-
else:
465-
logger.warning("No commits found for range '%s'", commit_range)
466-
return None, None, None
464+
logger.warning("No commits found for range '%s'", commit_range)
465+
return None, None, None
467466
except Exception as e:
468467
logger.warning("Failed to parse commit range '%s'", commit_range, exc_info=e)
469468
return None, None, None

tests/cli/files_collector/test_commit_range_documents.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -891,14 +891,14 @@ def test_parse_all_for_empty_remote_scenario(self) -> None:
891891
test_file = os.path.join(temp_dir, 'test.py')
892892
with open(test_file, 'w') as f:
893893
f.write("print('test')")
894-
894+
895895
repo.index.add(['test.py'])
896896
commit = repo.index.commit('Initial commit')
897-
897+
898898
# Test that '--all' (returned by calculate_pre_push_commit_range for empty remote)
899899
# can be parsed to a valid commit range
900900
parsed_from, parsed_to, separator = parse_commit_range('--all', temp_dir)
901-
901+
902902
# Should return first commit to HEAD (which is the only commit in this case)
903903
assert parsed_from == commit.hexsha
904904
assert parsed_to == commit.hexsha
@@ -913,21 +913,21 @@ def test_parse_all_for_empty_remote_scenario_with_two_commits(self) -> None:
913913
test_file = os.path.join(temp_dir, 'test.py')
914914
with open(test_file, 'w') as f:
915915
f.write("print('test')")
916-
916+
917917
repo.index.add(['test.py'])
918918
commit1 = repo.index.commit('First commit')
919-
919+
920920
# Create second commit
921921
test_file2 = os.path.join(temp_dir, 'test2.py')
922922
with open(test_file2, 'w') as f:
923923
f.write("print('test2')")
924-
924+
925925
repo.index.add(['test2.py'])
926926
commit2 = repo.index.commit('Second commit')
927-
927+
928928
# Test that '--all' returns first commit to HEAD (second commit)
929929
parsed_from, parsed_to, separator = parse_commit_range('--all', temp_dir)
930-
930+
931931
# Should return first commit to HEAD (second commit)
932932
assert parsed_from == commit1.hexsha # First commit
933933
assert parsed_to == commit2.hexsha # HEAD (second commit)
@@ -943,6 +943,7 @@ def test_parse_all_with_empty_repository_returns_none(self) -> None:
943943
assert parsed_to is None
944944
assert separator is None
945945

946+
946947
class TestParsePreReceiveInput:
947948
"""Test the parse_pre_receive_input function with various pre-receive hook input scenarios."""
948949

0 commit comments

Comments
 (0)