Skip to content

Commit

Permalink
Enable intro and chat text for PR code suggestions in configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mrT23 committed Sep 26, 2024
1 parent 89f9cf5 commit 8bdebcb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions pr_agent/settings/configuration.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,7 @@ enable_review_labels_effort=true
require_all_thresholds_for_incremental_review=false
minimal_commits_for_incremental_review=0
minimal_minutes_for_incremental_review=0
enable_intro_text=true
enable_help_text=false # Determines whether to include help text in the PR review. Enabled by default.
enable_chat_text=false
# auto approval
enable_auto_approval=false
maximal_review_effort=5
Expand Down Expand Up @@ -114,6 +112,8 @@ commitable_code_suggestions = false
extra_instructions = ""
rank_suggestions = false
enable_help_text=false
enable_chat_text=true
enable_intro_text=true
persistent_comment=true
max_history_len=4
# enable to apply suggestion 💎
Expand Down
8 changes: 3 additions & 5 deletions pr_agent/tools/pr_code_suggestions.py
Original file line number Diff line number Diff line change
Expand Up @@ -615,21 +615,19 @@ def generate_summarized_suggestions(self, data: Dict) -> str:
try:
pr_body = "## PR Code Suggestions ✨\n\n"

if get_settings().pr_code_suggestions.enable_intro_text and get_settings().config.is_auto_command:
pr_body += "Explore these optional code suggestions:\n\n"

if len(data.get('code_suggestions', [])) == 0:
pr_body += "No suggestions found to improve this PR."
return pr_body

if get_settings().pr_code_suggestions.enable_intro_text and get_settings().config.is_auto_command:
pr_body += "Explore these optional code suggestions:\n\n"

language_extension_map_org = get_settings().language_extension_map_org
extension_to_language = {}
for language, extensions in language_extension_map_org.items():
for ext in extensions:
extension_to_language[ext] = language

pr_body = "## PR Code Suggestions ✨\n\n"

pr_body += "<table>"
header = f"Suggestion"
delta = 66
Expand Down

0 comments on commit 8bdebcb

Please sign in to comment.