|
12 | 12 | from pathlib import Path |
13 | 13 | from typing import TYPE_CHECKING |
14 | 14 |
|
15 | | -import isort |
16 | 15 | import libcst as cst |
17 | 16 | from rich.console import Group |
18 | 17 | from rich.panel import Panel |
@@ -900,7 +899,7 @@ def reformat_code_and_helpers( |
900 | 899 | optimized_context: CodeStringsMarkdown, |
901 | 900 | ) -> tuple[str, dict[Path, str]]: |
902 | 901 | should_sort_imports = not self.args.disable_imports_sorting |
903 | | - if should_sort_imports and isort.code(original_code) != original_code: |
| 902 | + if should_sort_imports and sort_imports(code=original_code) != original_code: |
904 | 903 | should_sort_imports = False |
905 | 904 |
|
906 | 905 | optimized_code = "" |
@@ -1461,14 +1460,12 @@ def process_review( |
1461 | 1460 |
|
1462 | 1461 | if raise_pr or staging_review: |
1463 | 1462 | data["root_dir"] = git_root_dir() |
1464 | | - # try: |
1465 | | - # # modify argument of staging vs pr based on the impact |
1466 | | - # opt_impact_response = self.aiservice_client.get_optimization_impact(**data) |
1467 | | - # if opt_impact_response == "low": |
1468 | | - # raise_pr = False |
1469 | | - # staging_review = True |
1470 | | - # except Exception as e: |
1471 | | - # logger.debug(f"optimization impact response failed, investigate {e}") |
| 1463 | + opt_impact_response = "" |
| 1464 | + try: |
| 1465 | + opt_impact_response = self.aiservice_client.get_optimization_impact(**data) |
| 1466 | + except Exception as e: |
| 1467 | + logger.debug(f"optimization impact response failed, investigate {e}") |
| 1468 | + data["optimization_impact"] = opt_impact_response |
1472 | 1469 | if raise_pr and not staging_review: |
1473 | 1470 | data["git_remote"] = self.args.git_remote |
1474 | 1471 | check_create_pr(**data) |
|
0 commit comments