Skip to content

Commit 5ecbd46

Browse files
committed
add_lang_ext_support_to_diff
1 parent 1e92f3d commit 5ecbd46

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

codeflash/code_utils/git_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from unidiff import PatchSet
1414

1515
from codeflash.cli_cmds.console import logger
16+
from codeflash.languages.registry import get_supported_extensions
1617

1718
if TYPE_CHECKING:
1819
from git import Repo
@@ -35,11 +36,12 @@ def get_git_diff(
3536
uni_diff_text = repository.git.diff(
3637
commit.hexsha + "^1", commit.hexsha, ignore_blank_lines=True, ignore_space_at_eol=True
3738
)
39+
supported_extensions = set(get_supported_extensions())
3840
patch_set = PatchSet(StringIO(uni_diff_text))
3941
change_list: dict[str, list[int]] = {} # list of changes
4042
for patched_file in patch_set:
4143
file_path: Path = Path(patched_file.path)
42-
if file_path.suffix != ".py":
44+
if file_path.suffix not in supported_extensions:
4345
continue
4446
file_path = Path(repository.working_dir) / file_path
4547
logger.debug(f"file name: {file_path}")

0 commit comments

Comments
 (0)