mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 05:10:38 +08:00
pattern_back
This commit is contained in:
@ -967,9 +967,11 @@ def process_description(description_full: str):
|
|||||||
try:
|
try:
|
||||||
if isinstance(file_data, tuple):
|
if isinstance(file_data, tuple):
|
||||||
file_data = file_data[0]
|
file_data = file_data[0]
|
||||||
# pattern = r'<details>\s*<summary><strong>(.*?)</strong><dd><code>(.*?)</code>.*?</summary>\s*<hr>\s*(.*?)\s*((?:\*.*\s*)*)</details>'
|
pattern = r'<details>\s*<summary><strong>(.*?)</strong>\s*<dd><code>(.*?)</code>.*?</summary>\s*<hr>\s*(.*?)\s*<li>(.*?)</details>'
|
||||||
pattern = r'<details>\s*<summary><strong>(.*?)</strong><dd><code>(.*?)</code>.*?</summary>\s*<hr>\s*(.*?)\n\n\s*(.*?)</details>'
|
|
||||||
res = re.search(pattern, file_data, re.DOTALL)
|
res = re.search(pattern, file_data, re.DOTALL)
|
||||||
|
if not res or res.lastindex != 4:
|
||||||
|
pattern_back = r'<details>\s*<summary><strong>(.*?)</strong><dd><code>(.*?)</code>.*?</summary>\s*<hr>\s*(.*?)\n\n\s*(.*?)</details>'
|
||||||
|
res = re.search(pattern_back, file_data, re.DOTALL)
|
||||||
if res and res.lastindex == 4:
|
if res and res.lastindex == 4:
|
||||||
short_filename = res.group(1).strip()
|
short_filename = res.group(1).strip()
|
||||||
short_summary = res.group(2).strip()
|
short_summary = res.group(2).strip()
|
||||||
|
@ -517,8 +517,7 @@ class PRCodeSuggestions:
|
|||||||
|
|
||||||
async def _prepare_prediction_extended(self, model: str) -> dict:
|
async def _prepare_prediction_extended(self, model: str) -> dict:
|
||||||
self.patches_diff_list = get_pr_multi_diffs(self.git_provider, self.token_handler, model,
|
self.patches_diff_list = get_pr_multi_diffs(self.git_provider, self.token_handler, model,
|
||||||
max_calls=get_settings().pr_code_suggestions.max_number_of_calls,
|
max_calls=get_settings().pr_code_suggestions.max_number_of_calls)
|
||||||
pr_description_files =self.pr_description_files)
|
|
||||||
if self.patches_diff_list:
|
if self.patches_diff_list:
|
||||||
get_logger().info(f"Number of PR chunk calls: {len(self.patches_diff_list)}")
|
get_logger().info(f"Number of PR chunk calls: {len(self.patches_diff_list)}")
|
||||||
get_logger().debug(f"PR diff:", artifact=self.patches_diff_list)
|
get_logger().debug(f"PR diff:", artifact=self.patches_diff_list)
|
||||||
|
Reference in New Issue
Block a user